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.UIIn;
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.InTagDeclaration}.
33   */
34  public final class InTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(InTag.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  password;
41    private javax.el.ValueExpression  tip;
42    private javax.el.MethodExpression  suggestMethod;
43    private javax.el.ValueExpression  suggestDelay;
44    private javax.el.MethodExpression  valueChangeListener;
45    private javax.el.ValueExpression  converter;
46    private javax.el.ValueExpression  value;
47    private javax.el.ValueExpression  focus;
48    private javax.el.ValueExpression  suggestMinChars;
49    private javax.el.ValueExpression  required;
50    private javax.el.ValueExpression  converterMessage;
51    private javax.el.ValueExpression  placeholder;
52    private javax.el.ValueExpression  label;
53    private javax.el.ValueExpression  autocomplete;
54    private javax.el.ValueExpression  requiredMessage;
55    private javax.el.ValueExpression  onchange;
56    private javax.el.ValueExpression  readonly;
57    private javax.el.ValueExpression  disabled;
58  
59    @Override
60    public String getComponentType() {
61      return UIIn.COMPONENT_TYPE;
62    }
63    @Override
64    public String getRendererType() {
65      return "In";
66    }
67  
68    @Override
69    protected void setProperties(final UIComponent uiComponent) {
70      super.setProperties(uiComponent);
71      final UIIn component = (UIIn) uiComponent;
72      final FacesContext context = FacesContext.getCurrentInstance();
73      final Application application = context.getApplication();
74      if (validatorMessage != null) {
75        component.setValueExpression("validatorMessage", validatorMessage);
76      }
77  
78      if (markup != null) {
79        if (!markup.isLiteralText()) {
80          component.setValueExpression("markup", markup);
81        } else {
82          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
83        }
84      }
85      if (validator != null) {
86        component.addValidator(new javax.faces.validator.MethodExpressionValidator(validator));
87      }
88      if (tabIndex != null) {
89        if (!tabIndex.isLiteralText()) {
90          component.setValueExpression("tabIndex", tabIndex);
91        } else {
92          component.setTabIndex(Integer.parseInt(tabIndex.getExpressionString()));
93        }
94      }
95      if (password != null) {
96        if (!password.isLiteralText()) {
97          component.setValueExpression("password", password);
98        } else {
99          component.setPassword(Boolean.parseBoolean(password.getExpressionString()));
100       }
101     }
102     if (tip != null) {
103       component.setValueExpression("tip", tip);
104     }
105 
106     if (suggestMethod != null) {
107       component.setSuggestMethodExpression(suggestMethod);
108     }
109     if (suggestDelay != null) {
110       if (!suggestDelay.isLiteralText()) {
111         component.setValueExpression("suggestDelay", suggestDelay);
112       } else {
113         component.setSuggestDelay(Integer.parseInt(suggestDelay.getExpressionString()));
114       }
115     }
116     if (valueChangeListener != null) {
117       component.addValueChangeListener(new javax.faces.event.MethodExpressionValueChangeListener(valueChangeListener));
118     }
119     if (converter != null) {
120       if (!converter.isLiteralText()) {
121         component.setValueExpression("converter", converter);
122       } else {
123         component.setConverter(application.createConverter(converter.getExpressionString()));
124       }
125     }
126     if (value != null) {
127       component.setValueExpression("value", value);
128     }
129 
130     if (focus != null) {
131       if (!focus.isLiteralText()) {
132         component.setValueExpression("focus", focus);
133       } else {
134         component.setFocus(Boolean.parseBoolean(focus.getExpressionString()));
135       }
136     }
137     if (suggestMinChars != null) {
138       if (!suggestMinChars.isLiteralText()) {
139         component.setValueExpression("suggestMinChars", suggestMinChars);
140       } else {
141         component.setSuggestMinChars(Integer.parseInt(suggestMinChars.getExpressionString()));
142       }
143     }
144     if (required != null) {
145       if (!required.isLiteralText()) {
146         component.setValueExpression("required", required);
147       } else {
148         component.setRequired(Boolean.parseBoolean(required.getExpressionString()));
149       }
150     }
151     if (converterMessage != null) {
152       component.setValueExpression("converterMessage", converterMessage);
153     }
154 
155     if (placeholder != null) {
156       component.setValueExpression("placeholder", placeholder);
157     }
158 
159     if (label != null) {
160       component.setValueExpression("label", label);
161     }
162 
163     if (autocomplete != null) {
164       if (!autocomplete.isLiteralText()) {
165         component.setValueExpression("autocomplete", autocomplete);
166       } else {
167         component.setAutocomplete(Boolean.parseBoolean(autocomplete.getExpressionString()));
168       }
169     }
170     if (requiredMessage != null) {
171       component.setValueExpression("requiredMessage", requiredMessage);
172     }
173 
174     if (onchange != null) {
175       component.setValueExpression("onchange", onchange);
176     }
177 
178     if (readonly != null) {
179       if (!readonly.isLiteralText()) {
180         component.setValueExpression("readonly", readonly);
181       } else {
182         component.setReadonly(Boolean.parseBoolean(readonly.getExpressionString()));
183       }
184     }
185     if (disabled != null) {
186       if (!disabled.isLiteralText()) {
187         component.setValueExpression("disabled", disabled);
188       } else {
189         component.setDisabled(Boolean.parseBoolean(disabled.getExpressionString()));
190       }
191     }
192   }
193 
194   public javax.el.ValueExpression getValidatorMessage() {
195     return validatorMessage;
196   }
197 
198   public void setValidatorMessage(final javax.el.ValueExpression validatorMessage) {
199     this.validatorMessage = validatorMessage;
200   }
201 
202   public javax.el.ValueExpression getMarkup() {
203     return markup;
204   }
205 
206   public void setMarkup(final javax.el.ValueExpression markup) {
207     this.markup = markup;
208   }
209 
210   public javax.el.MethodExpression getValidator() {
211     return validator;
212   }
213 
214   public void setValidator(final javax.el.MethodExpression validator) {
215     this.validator = validator;
216   }
217 
218   public javax.el.ValueExpression getTabIndex() {
219     return tabIndex;
220   }
221 
222   public void setTabIndex(final javax.el.ValueExpression tabIndex) {
223     this.tabIndex = tabIndex;
224   }
225 
226   public javax.el.ValueExpression getPassword() {
227     return password;
228   }
229 
230   public void setPassword(final javax.el.ValueExpression password) {
231     this.password = password;
232   }
233 
234   public javax.el.ValueExpression getTip() {
235     return tip;
236   }
237 
238   public void setTip(final javax.el.ValueExpression tip) {
239     this.tip = tip;
240   }
241 
242   public javax.el.MethodExpression getSuggestMethod() {
243     return suggestMethod;
244   }
245 
246   public void setSuggestMethod(final javax.el.MethodExpression suggestMethod) {
247     this.suggestMethod = suggestMethod;
248   }
249 
250   public javax.el.ValueExpression getSuggestDelay() {
251     return suggestDelay;
252   }
253 
254   public void setSuggestDelay(final javax.el.ValueExpression suggestDelay) {
255     this.suggestDelay = suggestDelay;
256   }
257 
258   public javax.el.MethodExpression getValueChangeListener() {
259     return valueChangeListener;
260   }
261 
262   public void setValueChangeListener(final javax.el.MethodExpression valueChangeListener) {
263     this.valueChangeListener = valueChangeListener;
264   }
265 
266   public javax.el.ValueExpression getConverter() {
267     return converter;
268   }
269 
270   public void setConverter(final javax.el.ValueExpression converter) {
271     this.converter = converter;
272   }
273 
274   public javax.el.ValueExpression getValue() {
275     return value;
276   }
277 
278   public void setValue(final javax.el.ValueExpression value) {
279     this.value = value;
280   }
281 
282   public javax.el.ValueExpression getFocus() {
283     return focus;
284   }
285 
286   public void setFocus(final javax.el.ValueExpression focus) {
287     this.focus = focus;
288   }
289 
290   public javax.el.ValueExpression getSuggestMinChars() {
291     return suggestMinChars;
292   }
293 
294   public void setSuggestMinChars(final javax.el.ValueExpression suggestMinChars) {
295     this.suggestMinChars = suggestMinChars;
296   }
297 
298   public javax.el.ValueExpression getRequired() {
299     return required;
300   }
301 
302   public void setRequired(final javax.el.ValueExpression required) {
303     this.required = required;
304   }
305 
306   public javax.el.ValueExpression getConverterMessage() {
307     return converterMessage;
308   }
309 
310   public void setConverterMessage(final javax.el.ValueExpression converterMessage) {
311     this.converterMessage = converterMessage;
312   }
313 
314   public javax.el.ValueExpression getPlaceholder() {
315     return placeholder;
316   }
317 
318   public void setPlaceholder(final javax.el.ValueExpression placeholder) {
319     this.placeholder = placeholder;
320   }
321 
322   public javax.el.ValueExpression getLabel() {
323     return label;
324   }
325 
326   public void setLabel(final javax.el.ValueExpression label) {
327     this.label = label;
328   }
329 
330   public javax.el.ValueExpression getAutocomplete() {
331     return autocomplete;
332   }
333 
334   public void setAutocomplete(final javax.el.ValueExpression autocomplete) {
335     this.autocomplete = autocomplete;
336   }
337 
338   public javax.el.ValueExpression getRequiredMessage() {
339     return requiredMessage;
340   }
341 
342   public void setRequiredMessage(final javax.el.ValueExpression requiredMessage) {
343     this.requiredMessage = requiredMessage;
344   }
345 
346   public javax.el.ValueExpression getOnchange() {
347     return onchange;
348   }
349 
350   public void setOnchange(final javax.el.ValueExpression onchange) {
351     this.onchange = onchange;
352   }
353 
354   public javax.el.ValueExpression getReadonly() {
355     return readonly;
356   }
357 
358   public void setReadonly(final javax.el.ValueExpression readonly) {
359     this.readonly = readonly;
360   }
361 
362   public javax.el.ValueExpression getDisabled() {
363     return disabled;
364   }
365 
366   public void setDisabled(final javax.el.ValueExpression disabled) {
367     this.disabled = disabled;
368   }
369 
370 
371 
372   @Override
373   public void release() {
374     super.release();
375     validatorMessage = null;
376     markup = null;
377     validator = null;
378     tabIndex = null;
379     password = null;
380     tip = null;
381     suggestMethod = null;
382     suggestDelay = null;
383     valueChangeListener = null;
384     converter = null;
385     value = null;
386     focus = null;
387     suggestMinChars = null;
388     required = null;
389     converterMessage = null;
390     placeholder = null;
391     label = null;
392     autocomplete = null;
393     requiredMessage = null;
394     onchange = null;
395     readonly = null;
396     disabled = null;
397   }
398 }