View Javadoc

1   // ---------- Attention: Generated code, please do not modify! -----------  
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one or more
5    * contributor license agreements.  See the NOTICE file distributed with
6    * this work for additional information regarding copyright ownership.
7    * The ASF licenses this file to You under the Apache License, Version 2.0
8    * (the "License"); you may not use this file except in compliance with
9    * the License.  You may obtain a copy of the License at
10   *
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  package org.apache.myfaces.tobago.internal.taglib;
21  
22  import javax.faces.application.Application;
23  import javax.faces.component.UIComponent;
24  import javax.faces.context.FacesContext;
25  import org.apache.commons.lang.StringUtils;
26  import org.apache.myfaces.tobago.component.UILink;
27  import org.slf4j.Logger;
28  import org.slf4j.LoggerFactory;
29  
30  /** 
31   * JSP Tag class, generated from template {@code tag1.2.stg} with class 
32   * {@link org.apache.myfaces.tobago.internal.taglib.component.LinkTagDeclaration}.
33   */
34  public final class LinkTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(LinkTag.class);
36    private javax.el.MethodExpression  actionListener;
37    private javax.el.ValueExpression  accessKey;
38    private javax.el.ValueExpression  markup;
39    private javax.el.ValueExpression  labelWithAccessKey;
40    private javax.el.ValueExpression  link;
41    private javax.el.ValueExpression  tabIndex;
42    private javax.el.ValueExpression  tip;
43    private javax.el.ValueExpression  inline;
44    private javax.el.MethodExpression  action;
45    private javax.el.ValueExpression  jsfResource;
46    private javax.el.ValueExpression  resource;
47    private javax.el.ValueExpression  transition;
48    private javax.el.ValueExpression  image;
49    private javax.el.ValueExpression  label;
50    private javax.el.ValueExpression  immediate;
51    private javax.el.ValueExpression  renderedPartially;
52    private javax.el.ValueExpression  target;
53    private javax.el.ValueExpression  onclick;
54    private javax.el.ValueExpression  disabled;
55  
56    @Override
57    public String getComponentType() {
58      return UILink.COMPONENT_TYPE;
59    }
60    @Override
61    public String getRendererType() {
62      return "Link";
63    }
64  
65    @Override
66    protected void setProperties(final UIComponent uiComponent) {
67      super.setProperties(uiComponent);
68      final UILink component = (UILink) uiComponent;
69      final FacesContext context = FacesContext.getCurrentInstance();
70      final Application application = context.getApplication();
71      if (actionListener != null) {
72        component.addActionListener(new javax.faces.event.MethodExpressionActionListener(actionListener));
73      }
74      if (accessKey != null) {
75        if (!accessKey.isLiteralText()) {
76          component.setValueExpression("accessKey", accessKey);
77        } else {
78          component.setAccessKey(accessKey.getExpressionString().charAt(0));
79        }
80      }
81      if (markup != null) {
82        if (!markup.isLiteralText()) {
83          component.setValueExpression("markup", markup);
84        } else {
85          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
86        }
87      }
88      if (labelWithAccessKey != null) {
89        component.setValueExpression("labelWithAccessKey", labelWithAccessKey);
90      }
91  
92      if (link != null) {
93        component.setValueExpression("link", link);
94      }
95  
96      if (tabIndex != null) {
97        if (!tabIndex.isLiteralText()) {
98          component.setValueExpression("tabIndex", tabIndex);
99        } else {
100         component.setTabIndex(Integer.parseInt(tabIndex.getExpressionString()));
101       }
102     }
103     if (tip != null) {
104       component.setValueExpression("tip", tip);
105     }
106 
107     if (inline != null) {
108       if (!inline.isLiteralText()) {
109         component.setValueExpression("inline", inline);
110       } else {
111         component.setInline(Boolean.parseBoolean(inline.getExpressionString()));
112       }
113     }
114     if (action != null) {
115       component.setActionExpression(action);
116     }
117     if (jsfResource != null) {
118       if (!jsfResource.isLiteralText()) {
119         component.setValueExpression("jsfResource", jsfResource);
120       } else {
121         component.setJsfResource(Boolean.parseBoolean(jsfResource.getExpressionString()));
122       }
123     }
124     if (resource != null) {
125       component.setValueExpression("resource", resource);
126     }
127 
128     if (transition != null) {
129       if (!transition.isLiteralText()) {
130         component.setValueExpression("transition", transition);
131       } else {
132         component.setTransition(Boolean.parseBoolean(transition.getExpressionString()));
133       }
134     }
135     if (image != null) {
136       component.setValueExpression("image", image);
137     }
138 
139     if (label != null) {
140       component.setValueExpression("label", label);
141     }
142 
143     if (immediate != null) {
144       if (!immediate.isLiteralText()) {
145         component.setValueExpression("immediate", immediate);
146       } else {
147         component.setImmediate(Boolean.parseBoolean(immediate.getExpressionString()));
148       }
149     }
150     if (renderedPartially != null) {
151       if (!renderedPartially.isLiteralText()) {
152         component.setValueExpression("renderedPartially", renderedPartially);
153       } else {
154         component.setRenderedPartially(splitList(renderedPartially.getExpressionString()));
155       }
156     }
157     if (target != null) {
158       component.setValueExpression("target", target);
159     }
160 
161     if (onclick != null) {
162       component.setValueExpression("onclick", onclick);
163     }
164 
165     if (disabled != null) {
166       if (!disabled.isLiteralText()) {
167         component.setValueExpression("disabled", disabled);
168       } else {
169         component.setDisabled(Boolean.parseBoolean(disabled.getExpressionString()));
170       }
171     }
172   }
173 
174   public javax.el.MethodExpression getActionListener() {
175     return actionListener;
176   }
177 
178   public void setActionListener(final javax.el.MethodExpression actionListener) {
179     this.actionListener = actionListener;
180   }
181 
182   public javax.el.ValueExpression getAccessKey() {
183     return accessKey;
184   }
185 
186   public void setAccessKey(final javax.el.ValueExpression accessKey) {
187     this.accessKey = accessKey;
188   }
189 
190   public javax.el.ValueExpression getMarkup() {
191     return markup;
192   }
193 
194   public void setMarkup(final javax.el.ValueExpression markup) {
195     this.markup = markup;
196   }
197 
198   public javax.el.ValueExpression getLabelWithAccessKey() {
199     return labelWithAccessKey;
200   }
201 
202   public void setLabelWithAccessKey(final javax.el.ValueExpression labelWithAccessKey) {
203     this.labelWithAccessKey = labelWithAccessKey;
204   }
205 
206   public javax.el.ValueExpression getLink() {
207     return link;
208   }
209 
210   public void setLink(final javax.el.ValueExpression link) {
211     this.link = link;
212   }
213 
214   public javax.el.ValueExpression getTabIndex() {
215     return tabIndex;
216   }
217 
218   public void setTabIndex(final javax.el.ValueExpression tabIndex) {
219     this.tabIndex = tabIndex;
220   }
221 
222   public javax.el.ValueExpression getTip() {
223     return tip;
224   }
225 
226   public void setTip(final javax.el.ValueExpression tip) {
227     this.tip = tip;
228   }
229 
230   public javax.el.ValueExpression getInline() {
231     return inline;
232   }
233 
234   public void setInline(final javax.el.ValueExpression inline) {
235     this.inline = inline;
236   }
237 
238   public javax.el.MethodExpression getAction() {
239     return action;
240   }
241 
242   public void setAction(final javax.el.MethodExpression action) {
243     this.action = action;
244   }
245 
246   public javax.el.ValueExpression getJsfResource() {
247     return jsfResource;
248   }
249 
250   public void setJsfResource(final javax.el.ValueExpression jsfResource) {
251     this.jsfResource = jsfResource;
252   }
253 
254   public javax.el.ValueExpression getResource() {
255     return resource;
256   }
257 
258   public void setResource(final javax.el.ValueExpression resource) {
259     this.resource = resource;
260   }
261 
262   public javax.el.ValueExpression getTransition() {
263     return transition;
264   }
265 
266   public void setTransition(final javax.el.ValueExpression transition) {
267     this.transition = transition;
268   }
269 
270   public javax.el.ValueExpression getImage() {
271     return image;
272   }
273 
274   public void setImage(final javax.el.ValueExpression image) {
275     this.image = image;
276   }
277 
278   public javax.el.ValueExpression getLabel() {
279     return label;
280   }
281 
282   public void setLabel(final javax.el.ValueExpression label) {
283     this.label = label;
284   }
285 
286   public javax.el.ValueExpression getImmediate() {
287     return immediate;
288   }
289 
290   public void setImmediate(final javax.el.ValueExpression immediate) {
291     this.immediate = immediate;
292   }
293 
294   public javax.el.ValueExpression getRenderedPartially() {
295     return renderedPartially;
296   }
297 
298   public void setRenderedPartially(final javax.el.ValueExpression renderedPartially) {
299     this.renderedPartially = renderedPartially;
300   }
301 
302   public javax.el.ValueExpression getTarget() {
303     return target;
304   }
305 
306   public void setTarget(final javax.el.ValueExpression target) {
307     this.target = target;
308   }
309 
310   public javax.el.ValueExpression getOnclick() {
311     return onclick;
312   }
313 
314   public void setOnclick(final javax.el.ValueExpression onclick) {
315     this.onclick = onclick;
316   }
317 
318   public javax.el.ValueExpression getDisabled() {
319     return disabled;
320   }
321 
322   public void setDisabled(final javax.el.ValueExpression disabled) {
323     this.disabled = disabled;
324   }
325 
326 
327 
328   @Override
329   public void release() {
330     super.release();
331     actionListener = null;
332     accessKey = null;
333     markup = null;
334     labelWithAccessKey = null;
335     link = null;
336     tabIndex = null;
337     tip = null;
338     inline = null;
339     action = null;
340     jsfResource = null;
341     resource = null;
342     transition = null;
343     image = null;
344     label = null;
345     immediate = null;
346     renderedPartially = null;
347     target = null;
348     onclick = null;
349     disabled = null;
350   }
351 }