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