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.myfaces.tobago.component.UILink;
26  import org.apache.myfaces.tobago.internal.util.StringUtils;
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  link;
40    private javax.el.ValueExpression  labelWithAccessKey;
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  omit;
52    private javax.el.ValueExpression  renderedPartially;
53    private javax.el.ValueExpression  target;
54    private javax.el.ValueExpression  onclick;
55    private javax.el.ValueExpression  disabled;
56  
57    @Override
58    public String getComponentType() {
59      return UILink.COMPONENT_TYPE;
60    }
61    @Override
62    public String getRendererType() {
63      return "Link";
64    }
65  
66    @Override
67    protected void setProperties(final UIComponent uiComponent) {
68      super.setProperties(uiComponent);
69      final UILink component = (UILink) uiComponent;
70      final FacesContext context = FacesContext.getCurrentInstance();
71      final Application application = context.getApplication();
72      if (actionListener != null) {
73        component.addActionListener(new javax.faces.event.MethodExpressionActionListener(actionListener));
74      }
75      if (accessKey != null) {
76        if (!accessKey.isLiteralText()) {
77          component.setValueExpression("accessKey", accessKey);
78        } else {
79          component.setAccessKey(accessKey.getExpressionString().charAt(0));
80        }
81      }
82      if (markup != null) {
83        if (!markup.isLiteralText()) {
84          component.setValueExpression("markup", markup);
85        } else {
86          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
87        }
88      }
89      if (link != null) {
90        component.setValueExpression("link", link);
91      }
92  
93      if (labelWithAccessKey != null) {
94        component.setValueExpression("labelWithAccessKey", labelWithAccessKey);
95      }
96  
97      if (tabIndex != null) {
98        if (!tabIndex.isLiteralText()) {
99          component.setValueExpression("tabIndex", tabIndex);
100       } else {
101         component.setTabIndex(Integer.parseInt(tabIndex.getExpressionString()));
102       }
103     }
104     if (tip != null) {
105       component.setValueExpression("tip", tip);
106     }
107 
108     if (inline != null) {
109       if (!inline.isLiteralText()) {
110         component.setValueExpression("inline", inline);
111       } else {
112         component.setInline(Boolean.parseBoolean(inline.getExpressionString()));
113       }
114     }
115     if (action != null) {
116       component.setActionExpression(action);
117     }
118     if (jsfResource != null) {
119       if (!jsfResource.isLiteralText()) {
120         component.setValueExpression("jsfResource", jsfResource);
121       } else {
122         component.setJsfResource(Boolean.parseBoolean(jsfResource.getExpressionString()));
123       }
124     }
125     if (resource != null) {
126       component.setValueExpression("resource", resource);
127     }
128 
129     if (transition != null) {
130       if (!transition.isLiteralText()) {
131         component.setValueExpression("transition", transition);
132       } else {
133         component.setTransition(Boolean.parseBoolean(transition.getExpressionString()));
134       }
135     }
136     if (image != null) {
137       component.setValueExpression("image", image);
138     }
139 
140     if (label != null) {
141       component.setValueExpression("label", label);
142     }
143 
144     if (immediate != null) {
145       if (!immediate.isLiteralText()) {
146         component.setValueExpression("immediate", immediate);
147       } else {
148         component.setImmediate(Boolean.parseBoolean(immediate.getExpressionString()));
149       }
150     }
151     if (omit != null) {
152       if (!omit.isLiteralText()) {
153         component.setValueExpression("omit", omit);
154       } else {
155         component.setOmit(Boolean.parseBoolean(omit.getExpressionString()));
156       }
157     }
158     if (renderedPartially != null) {
159       if (!renderedPartially.isLiteralText()) {
160         component.setValueExpression("renderedPartially", renderedPartially);
161       } else {
162         component.setRenderedPartially(splitList(renderedPartially.getExpressionString()));
163       }
164     }
165     if (target != null) {
166       component.setValueExpression("target", target);
167     }
168 
169     if (onclick != null) {
170       component.setValueExpression("onclick", onclick);
171     }
172 
173     if (disabled != null) {
174       if (!disabled.isLiteralText()) {
175         component.setValueExpression("disabled", disabled);
176       } else {
177         component.setDisabled(Boolean.parseBoolean(disabled.getExpressionString()));
178       }
179     }
180   }
181 
182   public javax.el.MethodExpression getActionListener() {
183     return actionListener;
184   }
185 
186   public void setActionListener(final javax.el.MethodExpression actionListener) {
187     this.actionListener = actionListener;
188   }
189 
190   public javax.el.ValueExpression getAccessKey() {
191     return accessKey;
192   }
193 
194   public void setAccessKey(final javax.el.ValueExpression accessKey) {
195     this.accessKey = accessKey;
196   }
197 
198   public javax.el.ValueExpression getMarkup() {
199     return markup;
200   }
201 
202   public void setMarkup(final javax.el.ValueExpression markup) {
203     this.markup = markup;
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 getLabelWithAccessKey() {
215     return labelWithAccessKey;
216   }
217 
218   public void setLabelWithAccessKey(final javax.el.ValueExpression labelWithAccessKey) {
219     this.labelWithAccessKey = labelWithAccessKey;
220   }
221 
222   public javax.el.ValueExpression getTabIndex() {
223     return tabIndex;
224   }
225 
226   public void setTabIndex(final javax.el.ValueExpression tabIndex) {
227     this.tabIndex = tabIndex;
228   }
229 
230   public javax.el.ValueExpression getTip() {
231     return tip;
232   }
233 
234   public void setTip(final javax.el.ValueExpression tip) {
235     this.tip = tip;
236   }
237 
238   public javax.el.ValueExpression getInline() {
239     return inline;
240   }
241 
242   public void setInline(final javax.el.ValueExpression inline) {
243     this.inline = inline;
244   }
245 
246   public javax.el.MethodExpression getAction() {
247     return action;
248   }
249 
250   public void setAction(final javax.el.MethodExpression action) {
251     this.action = action;
252   }
253 
254   public javax.el.ValueExpression getJsfResource() {
255     return jsfResource;
256   }
257 
258   public void setJsfResource(final javax.el.ValueExpression jsfResource) {
259     this.jsfResource = jsfResource;
260   }
261 
262   public javax.el.ValueExpression getResource() {
263     return resource;
264   }
265 
266   public void setResource(final javax.el.ValueExpression resource) {
267     this.resource = resource;
268   }
269 
270   public javax.el.ValueExpression getTransition() {
271     return transition;
272   }
273 
274   public void setTransition(final javax.el.ValueExpression transition) {
275     this.transition = transition;
276   }
277 
278   public javax.el.ValueExpression getImage() {
279     return image;
280   }
281 
282   public void setImage(final javax.el.ValueExpression image) {
283     this.image = image;
284   }
285 
286   public javax.el.ValueExpression getLabel() {
287     return label;
288   }
289 
290   public void setLabel(final javax.el.ValueExpression label) {
291     this.label = label;
292   }
293 
294   public javax.el.ValueExpression getImmediate() {
295     return immediate;
296   }
297 
298   public void setImmediate(final javax.el.ValueExpression immediate) {
299     this.immediate = immediate;
300   }
301 
302   public javax.el.ValueExpression getOmit() {
303     return omit;
304   }
305 
306   public void setOmit(final javax.el.ValueExpression omit) {
307     this.omit = omit;
308   }
309 
310   public javax.el.ValueExpression getRenderedPartially() {
311     return renderedPartially;
312   }
313 
314   public void setRenderedPartially(final javax.el.ValueExpression renderedPartially) {
315     this.renderedPartially = renderedPartially;
316   }
317 
318   public javax.el.ValueExpression getTarget() {
319     return target;
320   }
321 
322   public void setTarget(final javax.el.ValueExpression target) {
323     this.target = target;
324   }
325 
326   public javax.el.ValueExpression getOnclick() {
327     return onclick;
328   }
329 
330   public void setOnclick(final javax.el.ValueExpression onclick) {
331     this.onclick = onclick;
332   }
333 
334   public javax.el.ValueExpression getDisabled() {
335     return disabled;
336   }
337 
338   public void setDisabled(final javax.el.ValueExpression disabled) {
339     this.disabled = disabled;
340   }
341 
342 
343 
344   @Override
345   public void release() {
346     super.release();
347     actionListener = null;
348     accessKey = null;
349     markup = null;
350     link = null;
351     labelWithAccessKey = null;
352     tabIndex = null;
353     tip = null;
354     inline = null;
355     action = null;
356     jsfResource = null;
357     resource = null;
358     transition = null;
359     image = null;
360     label = null;
361     immediate = null;
362     omit = null;
363     renderedPartially = null;
364     target = null;
365     onclick = null;
366     disabled = null;
367   }
368 }