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