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