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.UILabel;
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.LabelTagDeclaration}.
33   */
34  public final class LabelTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(LabelTag.class);
36    private javax.el.ValueExpression  markup;
37    private javax.el.ValueExpression  accessKey;
38    private String forComponent;
39    private javax.el.ValueExpression  labelWithAccessKey;
40    private javax.el.ValueExpression  tip;
41    private javax.el.ValueExpression  inline;
42    private javax.el.ValueExpression  value;
43  
44    @Override
45    public String getComponentType() {
46      return UILabel.COMPONENT_TYPE;
47    }
48    @Override
49    public String getRendererType() {
50      return "Label";
51    }
52  
53    @Override
54    protected void setProperties(final UIComponent uiComponent) {
55      super.setProperties(uiComponent);
56      final UILabel component = (UILabel) uiComponent;
57      final FacesContext context = FacesContext.getCurrentInstance();
58      final Application application = context.getApplication();
59      if (markup != null) {
60        if (!markup.isLiteralText()) {
61          component.setValueExpression("markup", markup);
62        } else {
63          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
64        }
65      }
66      if (accessKey != null) {
67        if (!accessKey.isLiteralText()) {
68          component.setValueExpression("accessKey", accessKey);
69        } else {
70          component.setAccessKey(accessKey.getExpressionString().charAt(0));
71        }
72      }
73      if (forComponent != null) {
74        component.setFor(forComponent);
75      }
76  
77      if (labelWithAccessKey != null) {
78        component.setValueExpression("labelWithAccessKey", labelWithAccessKey);
79      }
80  
81      if (tip != null) {
82        component.setValueExpression("tip", tip);
83      }
84  
85      if (inline != null) {
86        if (!inline.isLiteralText()) {
87          component.setValueExpression("inline", inline);
88        } else {
89          component.setInline(Boolean.parseBoolean(inline.getExpressionString()));
90        }
91      }
92      if (value != null) {
93        component.setValueExpression("value", value);
94      }
95  
96    }
97  
98    public javax.el.ValueExpression getMarkup() {
99      return markup;
100   }
101 
102   public void setMarkup(final javax.el.ValueExpression markup) {
103     this.markup = markup;
104   }
105 
106   public javax.el.ValueExpression getAccessKey() {
107     return accessKey;
108   }
109 
110   public void setAccessKey(final javax.el.ValueExpression accessKey) {
111     this.accessKey = accessKey;
112   }
113 
114   public String getFor() {
115     return forComponent;
116   }
117 
118   public void setFor(final String forComponent) {
119     this.forComponent = forComponent;
120   }
121 
122   public javax.el.ValueExpression getLabelWithAccessKey() {
123     return labelWithAccessKey;
124   }
125 
126   public void setLabelWithAccessKey(final javax.el.ValueExpression labelWithAccessKey) {
127     this.labelWithAccessKey = labelWithAccessKey;
128   }
129 
130   public javax.el.ValueExpression getTip() {
131     return tip;
132   }
133 
134   public void setTip(final javax.el.ValueExpression tip) {
135     this.tip = tip;
136   }
137 
138   public javax.el.ValueExpression getInline() {
139     return inline;
140   }
141 
142   public void setInline(final javax.el.ValueExpression inline) {
143     this.inline = inline;
144   }
145 
146   public javax.el.ValueExpression getValue() {
147     return value;
148   }
149 
150   public void setValue(final javax.el.ValueExpression value) {
151     this.value = value;
152   }
153 
154 
155 
156   @Override
157   public void release() {
158     super.release();
159     markup = null;
160     accessKey = null;
161     forComponent = null;
162     labelWithAccessKey = null;
163     tip = null;
164     inline = null;
165     value = null;
166   }
167 }