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.UIReload;
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.ReloadTagDeclaration}.
33   */
34  public final class ReloadTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(ReloadTag.class);
36    private javax.el.ValueExpression  update;
37    private javax.el.ValueExpression  immediate;
38    private javax.el.ValueExpression  frequency;
39  
40    @Override
41    public String getComponentType() {
42      return UIReload.COMPONENT_TYPE;
43    }
44    @Override
45    public String getRendererType() {
46      return null;
47    }
48  
49    @Override
50    protected void setProperties(final UIComponent uiComponent) {
51      super.setProperties(uiComponent);
52      final UIReload component = (UIReload) uiComponent;
53      final FacesContext context = FacesContext.getCurrentInstance();
54      final Application application = context.getApplication();
55      if (update != null) {
56        if (!update.isLiteralText()) {
57          component.setValueExpression("update", update);
58        } else {
59          component.setUpdate(Boolean.parseBoolean(update.getExpressionString()));
60        }
61      }
62      if (immediate != null) {
63        if (!immediate.isLiteralText()) {
64          component.setValueExpression("immediate", immediate);
65        } else {
66          component.setImmediate(Boolean.parseBoolean(immediate.getExpressionString()));
67        }
68      }
69      if (frequency != null) {
70        if (!frequency.isLiteralText()) {
71          component.setValueExpression("frequency", frequency);
72        } else {
73          component.setFrequency(Integer.parseInt(frequency.getExpressionString()));
74        }
75      }
76    }
77  
78    public javax.el.ValueExpression getUpdate() {
79      return update;
80    }
81  
82    public void setUpdate(final javax.el.ValueExpression update) {
83      this.update = update;
84    }
85  
86    public javax.el.ValueExpression getImmediate() {
87      return immediate;
88    }
89  
90    public void setImmediate(final javax.el.ValueExpression immediate) {
91      this.immediate = immediate;
92    }
93  
94    public javax.el.ValueExpression getFrequency() {
95      return frequency;
96    }
97  
98    public void setFrequency(final javax.el.ValueExpression frequency) {
99      this.frequency = frequency;
100   }
101 
102 
103 
104   @Override
105   public void release() {
106     super.release();
107     update = null;
108     immediate = null;
109     frequency = null;
110   }
111 }