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.UITextarea;
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.TextareaTagDeclaration}.
33   */
34  public final class TextareaTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(TextareaTag.class);
36    private javax.el.ValueExpression  validatorMessage;
37    private javax.el.ValueExpression  markup;
38    private javax.el.ValueExpression  accessKey;
39    private javax.el.MethodExpression  validator;
40    private javax.el.ValueExpression  labelWithAccessKey;
41    private javax.el.ValueExpression  tabIndex;
42    private javax.el.ValueExpression  tip;
43    private javax.el.MethodExpression  valueChangeListener;
44    private javax.el.ValueExpression  converter;
45    private javax.el.ValueExpression  value;
46    private javax.el.ValueExpression  focus;
47    private javax.el.ValueExpression  required;
48    private javax.el.ValueExpression  converterMessage;
49    private javax.el.ValueExpression  label;
50    private javax.el.ValueExpression  requiredMessage;
51    private javax.el.ValueExpression  onchange;
52    private javax.el.ValueExpression  rows;
53    private javax.el.ValueExpression  readonly;
54    private javax.el.ValueExpression  disabled;
55  
56    @Override
57    public String getComponentType() {
58      return UITextarea.COMPONENT_TYPE;
59    }
60    @Override
61    public String getRendererType() {
62      return "Textarea";
63    }
64  
65    @Override
66    protected void setProperties(final UIComponent uiComponent) {
67      super.setProperties(uiComponent);
68      final UITextarea component = (UITextarea) uiComponent;
69      final FacesContext context = FacesContext.getCurrentInstance();
70      final Application application = context.getApplication();
71      if (validatorMessage != null) {
72        component.setValueExpression("validatorMessage", validatorMessage);
73      }
74  
75      if (markup != null) {
76        if (!markup.isLiteralText()) {
77          component.setValueExpression("markup", markup);
78        } else {
79          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
80        }
81      }
82      if (accessKey != null) {
83        if (!accessKey.isLiteralText()) {
84          component.setValueExpression("accessKey", accessKey);
85        } else {
86          component.setAccessKey(accessKey.getExpressionString().charAt(0));
87        }
88      }
89      if (validator != null) {
90        component.addValidator(new javax.faces.validator.MethodExpressionValidator(validator));
91      }
92      if (labelWithAccessKey != null) {
93        component.setValueExpression("labelWithAccessKey", labelWithAccessKey);
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 (valueChangeListener != null) {
108       component.addValueChangeListener(new javax.faces.event.MethodExpressionValueChangeListener(valueChangeListener));
109     }
110     if (converter != null) {
111       if (!converter.isLiteralText()) {
112         component.setValueExpression("converter", converter);
113       } else {
114         component.setConverter(application.createConverter(converter.getExpressionString()));
115       }
116     }
117     if (value != null) {
118       component.setValueExpression("value", value);
119     }
120 
121     if (focus != null) {
122       if (!focus.isLiteralText()) {
123         component.setValueExpression("focus", focus);
124       } else {
125         component.setFocus(Boolean.parseBoolean(focus.getExpressionString()));
126       }
127     }
128     if (required != null) {
129       if (!required.isLiteralText()) {
130         component.setValueExpression("required", required);
131       } else {
132         component.setRequired(Boolean.parseBoolean(required.getExpressionString()));
133       }
134     }
135     if (converterMessage != null) {
136       component.setValueExpression("converterMessage", converterMessage);
137     }
138 
139     if (label != null) {
140       component.setValueExpression("label", label);
141     }
142 
143     if (requiredMessage != null) {
144       component.setValueExpression("requiredMessage", requiredMessage);
145     }
146 
147     if (onchange != null) {
148       component.setValueExpression("onchange", onchange);
149     }
150 
151     if (rows != null) {
152       if (!rows.isLiteralText()) {
153         component.setValueExpression("rows", rows);
154       } else {
155         component.setRows(Integer.parseInt(rows.getExpressionString()));
156       }
157     }
158     if (readonly != null) {
159       if (!readonly.isLiteralText()) {
160         component.setValueExpression("readonly", readonly);
161       } else {
162         component.setReadonly(Boolean.parseBoolean(readonly.getExpressionString()));
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.ValueExpression getValidatorMessage() {
175     return validatorMessage;
176   }
177 
178   public void setValidatorMessage(final javax.el.ValueExpression validatorMessage) {
179     this.validatorMessage = validatorMessage;
180   }
181 
182   public javax.el.ValueExpression getMarkup() {
183     return markup;
184   }
185 
186   public void setMarkup(final javax.el.ValueExpression markup) {
187     this.markup = markup;
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.MethodExpression getValidator() {
199     return validator;
200   }
201 
202   public void setValidator(final javax.el.MethodExpression validator) {
203     this.validator = validator;
204   }
205 
206   public javax.el.ValueExpression getLabelWithAccessKey() {
207     return labelWithAccessKey;
208   }
209 
210   public void setLabelWithAccessKey(final javax.el.ValueExpression labelWithAccessKey) {
211     this.labelWithAccessKey = labelWithAccessKey;
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.MethodExpression getValueChangeListener() {
231     return valueChangeListener;
232   }
233 
234   public void setValueChangeListener(final javax.el.MethodExpression valueChangeListener) {
235     this.valueChangeListener = valueChangeListener;
236   }
237 
238   public javax.el.ValueExpression getConverter() {
239     return converter;
240   }
241 
242   public void setConverter(final javax.el.ValueExpression converter) {
243     this.converter = converter;
244   }
245 
246   public javax.el.ValueExpression getValue() {
247     return value;
248   }
249 
250   public void setValue(final javax.el.ValueExpression value) {
251     this.value = value;
252   }
253 
254   public javax.el.ValueExpression getFocus() {
255     return focus;
256   }
257 
258   public void setFocus(final javax.el.ValueExpression focus) {
259     this.focus = focus;
260   }
261 
262   public javax.el.ValueExpression getRequired() {
263     return required;
264   }
265 
266   public void setRequired(final javax.el.ValueExpression required) {
267     this.required = required;
268   }
269 
270   public javax.el.ValueExpression getConverterMessage() {
271     return converterMessage;
272   }
273 
274   public void setConverterMessage(final javax.el.ValueExpression converterMessage) {
275     this.converterMessage = converterMessage;
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 getRequiredMessage() {
287     return requiredMessage;
288   }
289 
290   public void setRequiredMessage(final javax.el.ValueExpression requiredMessage) {
291     this.requiredMessage = requiredMessage;
292   }
293 
294   public javax.el.ValueExpression getOnchange() {
295     return onchange;
296   }
297 
298   public void setOnchange(final javax.el.ValueExpression onchange) {
299     this.onchange = onchange;
300   }
301 
302   public javax.el.ValueExpression getRows() {
303     return rows;
304   }
305 
306   public void setRows(final javax.el.ValueExpression rows) {
307     this.rows = rows;
308   }
309 
310   public javax.el.ValueExpression getReadonly() {
311     return readonly;
312   }
313 
314   public void setReadonly(final javax.el.ValueExpression readonly) {
315     this.readonly = readonly;
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     validatorMessage = null;
332     markup = null;
333     accessKey = null;
334     validator = null;
335     labelWithAccessKey = null;
336     tabIndex = null;
337     tip = null;
338     valueChangeListener = null;
339     converter = null;
340     value = null;
341     focus = null;
342     required = null;
343     converterMessage = null;
344     label = null;
345     requiredMessage = null;
346     onchange = null;
347     rows = null;
348     readonly = null;
349     disabled = null;
350   }
351 }