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