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.MethodExpression  validator;
39    private javax.el.ValueExpression  tabIndex;
40    private javax.el.ValueExpression  tip;
41    private javax.el.MethodExpression  valueChangeListener;
42    private javax.el.ValueExpression  converter;
43    private javax.el.ValueExpression  value;
44    private javax.el.ValueExpression  focus;
45    private javax.el.ValueExpression  required;
46    private javax.el.ValueExpression  converterMessage;
47    private javax.el.ValueExpression  sanitize;
48    private javax.el.ValueExpression  label;
49    private javax.el.ValueExpression  requiredMessage;
50    private javax.el.ValueExpression  onchange;
51    private javax.el.ValueExpression  rows;
52    private javax.el.ValueExpression  readonly;
53    private javax.el.ValueExpression  disabled;
54  
55    @Override
56    public String getComponentType() {
57      return UITextarea.COMPONENT_TYPE;
58    }
59    @Override
60    public String getRendererType() {
61      return "Textarea";
62    }
63  
64    @Override
65    protected void setProperties(final UIComponent uiComponent) {
66      super.setProperties(uiComponent);
67      final UITextarea component = (UITextarea) uiComponent;
68      final FacesContext context = FacesContext.getCurrentInstance();
69      final Application application = context.getApplication();
70      if (validatorMessage != null) {
71        component.setValueExpression("validatorMessage", validatorMessage);
72      }
73  
74      if (markup != null) {
75        if (!markup.isLiteralText()) {
76          component.setValueExpression("markup", markup);
77        } else {
78          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
79        }
80      }
81      if (validator != null) {
82        component.addValidator(new javax.faces.validator.MethodExpressionValidator(validator));
83      }
84      if (tabIndex != null) {
85        if (!tabIndex.isLiteralText()) {
86          component.setValueExpression("tabIndex", tabIndex);
87        } else {
88          component.setTabIndex(Integer.parseInt(tabIndex.getExpressionString()));
89        }
90      }
91      if (tip != null) {
92        component.setValueExpression("tip", tip);
93      }
94  
95      if (valueChangeListener != null) {
96        component.addValueChangeListener(new javax.faces.event.MethodExpressionValueChangeListener(valueChangeListener));
97      }
98      if (converter != null) {
99        if (!converter.isLiteralText()) {
100         component.setValueExpression("converter", converter);
101       } else {
102         component.setConverter(application.createConverter(converter.getExpressionString()));
103       }
104     }
105     if (value != null) {
106       component.setValueExpression("value", value);
107     }
108 
109     if (focus != null) {
110       if (!focus.isLiteralText()) {
111         component.setValueExpression("focus", focus);
112       } else {
113         component.setFocus(Boolean.parseBoolean(focus.getExpressionString()));
114       }
115     }
116     if (required != null) {
117       if (!required.isLiteralText()) {
118         component.setValueExpression("required", required);
119       } else {
120         component.setRequired(Boolean.parseBoolean(required.getExpressionString()));
121       }
122     }
123     if (converterMessage != null) {
124       component.setValueExpression("converterMessage", converterMessage);
125     }
126 
127     if (sanitize != null) {
128       component.setValueExpression("sanitize", sanitize);
129     }
130 
131     if (label != null) {
132       component.setValueExpression("label", label);
133     }
134 
135     if (requiredMessage != null) {
136       component.setValueExpression("requiredMessage", requiredMessage);
137     }
138 
139     if (onchange != null) {
140       component.setValueExpression("onchange", onchange);
141     }
142 
143     if (rows != null) {
144       if (!rows.isLiteralText()) {
145         component.setValueExpression("rows", rows);
146       } else {
147         component.setRows(Integer.parseInt(rows.getExpressionString()));
148       }
149     }
150     if (readonly != null) {
151       if (!readonly.isLiteralText()) {
152         component.setValueExpression("readonly", readonly);
153       } else {
154         component.setReadonly(Boolean.parseBoolean(readonly.getExpressionString()));
155       }
156     }
157     if (disabled != null) {
158       if (!disabled.isLiteralText()) {
159         component.setValueExpression("disabled", disabled);
160       } else {
161         component.setDisabled(Boolean.parseBoolean(disabled.getExpressionString()));
162       }
163     }
164   }
165 
166   public javax.el.ValueExpression getValidatorMessage() {
167     return validatorMessage;
168   }
169 
170   public void setValidatorMessage(final javax.el.ValueExpression validatorMessage) {
171     this.validatorMessage = validatorMessage;
172   }
173 
174   public javax.el.ValueExpression getMarkup() {
175     return markup;
176   }
177 
178   public void setMarkup(final javax.el.ValueExpression markup) {
179     this.markup = markup;
180   }
181 
182   public javax.el.MethodExpression getValidator() {
183     return validator;
184   }
185 
186   public void setValidator(final javax.el.MethodExpression validator) {
187     this.validator = validator;
188   }
189 
190   public javax.el.ValueExpression getTabIndex() {
191     return tabIndex;
192   }
193 
194   public void setTabIndex(final javax.el.ValueExpression tabIndex) {
195     this.tabIndex = tabIndex;
196   }
197 
198   public javax.el.ValueExpression getTip() {
199     return tip;
200   }
201 
202   public void setTip(final javax.el.ValueExpression tip) {
203     this.tip = tip;
204   }
205 
206   public javax.el.MethodExpression getValueChangeListener() {
207     return valueChangeListener;
208   }
209 
210   public void setValueChangeListener(final javax.el.MethodExpression valueChangeListener) {
211     this.valueChangeListener = valueChangeListener;
212   }
213 
214   public javax.el.ValueExpression getConverter() {
215     return converter;
216   }
217 
218   public void setConverter(final javax.el.ValueExpression converter) {
219     this.converter = converter;
220   }
221 
222   public javax.el.ValueExpression getValue() {
223     return value;
224   }
225 
226   public void setValue(final javax.el.ValueExpression value) {
227     this.value = value;
228   }
229 
230   public javax.el.ValueExpression getFocus() {
231     return focus;
232   }
233 
234   public void setFocus(final javax.el.ValueExpression focus) {
235     this.focus = focus;
236   }
237 
238   public javax.el.ValueExpression getRequired() {
239     return required;
240   }
241 
242   public void setRequired(final javax.el.ValueExpression required) {
243     this.required = required;
244   }
245 
246   public javax.el.ValueExpression getConverterMessage() {
247     return converterMessage;
248   }
249 
250   public void setConverterMessage(final javax.el.ValueExpression converterMessage) {
251     this.converterMessage = converterMessage;
252   }
253 
254   public javax.el.ValueExpression getSanitize() {
255     return sanitize;
256   }
257 
258   public void setSanitize(final javax.el.ValueExpression sanitize) {
259     this.sanitize = sanitize;
260   }
261 
262   public javax.el.ValueExpression getLabel() {
263     return label;
264   }
265 
266   public void setLabel(final javax.el.ValueExpression label) {
267     this.label = label;
268   }
269 
270   public javax.el.ValueExpression getRequiredMessage() {
271     return requiredMessage;
272   }
273 
274   public void setRequiredMessage(final javax.el.ValueExpression requiredMessage) {
275     this.requiredMessage = requiredMessage;
276   }
277 
278   public javax.el.ValueExpression getOnchange() {
279     return onchange;
280   }
281 
282   public void setOnchange(final javax.el.ValueExpression onchange) {
283     this.onchange = onchange;
284   }
285 
286   public javax.el.ValueExpression getRows() {
287     return rows;
288   }
289 
290   public void setRows(final javax.el.ValueExpression rows) {
291     this.rows = rows;
292   }
293 
294   public javax.el.ValueExpression getReadonly() {
295     return readonly;
296   }
297 
298   public void setReadonly(final javax.el.ValueExpression readonly) {
299     this.readonly = readonly;
300   }
301 
302   public javax.el.ValueExpression getDisabled() {
303     return disabled;
304   }
305 
306   public void setDisabled(final javax.el.ValueExpression disabled) {
307     this.disabled = disabled;
308   }
309 
310 
311 
312   @Override
313   public void release() {
314     super.release();
315     validatorMessage = null;
316     markup = null;
317     validator = null;
318     tabIndex = null;
319     tip = null;
320     valueChangeListener = null;
321     converter = null;
322     value = null;
323     focus = null;
324     required = null;
325     converterMessage = null;
326     sanitize = null;
327     label = null;
328     requiredMessage = null;
329     onchange = null;
330     rows = null;
331     readonly = null;
332     disabled = null;
333   }
334 }