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.UIOut;
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.OutTagDeclaration}.
33   */
34  public final class OutTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(OutTag.class);
36    private javax.el.ValueExpression  markup;
37    private javax.el.ValueExpression  escape;
38    private javax.el.ValueExpression  tip;
39    private javax.el.ValueExpression  converter;
40    private javax.el.ValueExpression  value;
41    private javax.el.ValueExpression  sanitize;
42  
43    @Override
44    public String getComponentType() {
45      return UIOut.COMPONENT_TYPE;
46    }
47    @Override
48    public String getRendererType() {
49      return "Out";
50    }
51  
52    @Override
53    protected void setProperties(final UIComponent uiComponent) {
54      super.setProperties(uiComponent);
55      final UIOut component = (UIOut) uiComponent;
56      final FacesContext context = FacesContext.getCurrentInstance();
57      final Application application = context.getApplication();
58      if (markup != null) {
59        if (!markup.isLiteralText()) {
60          component.setValueExpression("markup", markup);
61        } else {
62          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
63        }
64      }
65      if (escape != null) {
66        if (!escape.isLiteralText()) {
67          component.setValueExpression("escape", escape);
68        } else {
69          component.setEscape(Boolean.parseBoolean(escape.getExpressionString()));
70        }
71      }
72      if (tip != null) {
73        component.setValueExpression("tip", tip);
74      }
75  
76      if (converter != null) {
77        if (!converter.isLiteralText()) {
78          component.setValueExpression("converter", converter);
79        } else {
80          component.setConverter(application.createConverter(converter.getExpressionString()));
81        }
82      }
83      if (value != null) {
84        component.setValueExpression("value", value);
85      }
86  
87      if (sanitize != null) {
88        component.setValueExpression("sanitize", sanitize);
89      }
90  
91    }
92  
93    public javax.el.ValueExpression getMarkup() {
94      return markup;
95    }
96  
97    public void setMarkup(final javax.el.ValueExpression markup) {
98      this.markup = markup;
99    }
100 
101   public javax.el.ValueExpression getEscape() {
102     return escape;
103   }
104 
105   public void setEscape(final javax.el.ValueExpression escape) {
106     this.escape = escape;
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 getConverter() {
118     return converter;
119   }
120 
121   public void setConverter(final javax.el.ValueExpression converter) {
122     this.converter = converter;
123   }
124 
125   public javax.el.ValueExpression getValue() {
126     return value;
127   }
128 
129   public void setValue(final javax.el.ValueExpression value) {
130     this.value = value;
131   }
132 
133   public javax.el.ValueExpression getSanitize() {
134     return sanitize;
135   }
136 
137   public void setSanitize(final javax.el.ValueExpression sanitize) {
138     this.sanitize = sanitize;
139   }
140 
141 
142 
143   @Override
144   public void release() {
145     super.release();
146     markup = null;
147     escape = null;
148     tip = null;
149     converter = null;
150     value = null;
151     sanitize = null;
152   }
153 }