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