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  tip;
40    private javax.el.ValueExpression  value;
41  
42    @Override
43    public String getComponentType() {
44      return UILabel.COMPONENT_TYPE;
45    }
46    @Override
47    public String getRendererType() {
48      return "Label";
49    }
50  
51    @Override
52    protected void setProperties(final UIComponent uiComponent) {
53      super.setProperties(uiComponent);
54      final UILabel component = (UILabel) uiComponent;
55      final FacesContext context = FacesContext.getCurrentInstance();
56      final Application application = context.getApplication();
57      if (markup != null) {
58        if (!markup.isLiteralText()) {
59          component.setValueExpression("markup", markup);
60        } else {
61          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
62        }
63      }
64      if (accessKey != null) {
65        if (!accessKey.isLiteralText()) {
66          component.setValueExpression("accessKey", accessKey);
67        } else {
68          component.setAccessKey(accessKey.getExpressionString().charAt(0));
69        }
70      }
71      if (forComponent != null) {
72        component.setFor(forComponent);
73      }
74  
75      if (tip != null) {
76        component.setValueExpression("tip", tip);
77      }
78  
79      if (value != null) {
80        component.setValueExpression("value", value);
81      }
82  
83    }
84  
85    public javax.el.ValueExpression getMarkup() {
86      return markup;
87    }
88  
89    public void setMarkup(final javax.el.ValueExpression markup) {
90      this.markup = markup;
91    }
92  
93    public javax.el.ValueExpression getAccessKey() {
94      return accessKey;
95    }
96  
97    public void setAccessKey(final javax.el.ValueExpression accessKey) {
98      this.accessKey = accessKey;
99    }
100 
101   public String getFor() {
102     return forComponent;
103   }
104 
105   public void setFor(final String forComponent) {
106     this.forComponent = forComponent;
107   }
108 
109   public javax.el.ValueExpression getTip() {
110     return tip;
111   }
112 
113   public void setTip(final javax.el.ValueExpression tip) {
114     this.tip = tip;
115   }
116 
117   public javax.el.ValueExpression getValue() {
118     return value;
119   }
120 
121   public void setValue(final javax.el.ValueExpression value) {
122     this.value = value;
123   }
124 
125 
126 
127   @Override
128   public void release() {
129     super.release();
130     markup = null;
131     accessKey = null;
132     forComponent = null;
133     tip = null;
134     value = null;
135   }
136 }