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.UISuggest;
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.SuggestTagDeclaration}.
33   */
34  public final class SuggestTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(SuggestTag.class);
36    private javax.el.ValueExpression  update;
37    private javax.el.ValueExpression  maximumItems;
38    private javax.el.MethodExpression  suggestMethod;
39    private javax.el.ValueExpression  markup;
40    private javax.el.ValueExpression  totalCount;
41    private javax.el.ValueExpression  minimumCharacters;
42    private javax.el.ValueExpression  delay;
43    private javax.el.ValueExpression  filter;
44  
45    @Override
46    public String getComponentType() {
47      return UISuggest.COMPONENT_TYPE;
48    }
49    @Override
50    public String getRendererType() {
51      return "Suggest";
52    }
53  
54    @Override
55    protected void setProperties(final UIComponent uiComponent) {
56      super.setProperties(uiComponent);
57      final UISuggest component = (UISuggest) uiComponent;
58      final FacesContext context = FacesContext.getCurrentInstance();
59      final Application application = context.getApplication();
60      if (update != null) {
61        if (!update.isLiteralText()) {
62          component.setValueExpression("update", update);
63        } else {
64          component.setUpdate(Boolean.parseBoolean(update.getExpressionString()));
65        }
66      }
67      if (maximumItems != null) {
68        if (!maximumItems.isLiteralText()) {
69          component.setValueExpression("maximumItems", maximumItems);
70        } else {
71          component.setMaximumItems(Integer.parseInt(maximumItems.getExpressionString()));
72        }
73      }
74      if (suggestMethod != null) {
75        component.setSuggestMethodExpression(suggestMethod);
76      }
77      if (markup != null) {
78        if (!markup.isLiteralText()) {
79          component.setValueExpression("markup", markup);
80        } else {
81          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
82        }
83      }
84      if (totalCount != null) {
85        if (!totalCount.isLiteralText()) {
86          component.setValueExpression("totalCount", totalCount);
87        } else {
88          component.setTotalCount(Integer.parseInt(totalCount.getExpressionString()));
89        }
90      }
91      if (minimumCharacters != null) {
92        if (!minimumCharacters.isLiteralText()) {
93          component.setValueExpression("minimumCharacters", minimumCharacters);
94        } else {
95          component.setMinimumCharacters(Integer.parseInt(minimumCharacters.getExpressionString()));
96        }
97      }
98      if (delay != null) {
99        if (!delay.isLiteralText()) {
100         component.setValueExpression("delay", delay);
101       } else {
102         component.setDelay(Integer.parseInt(delay.getExpressionString()));
103       }
104     }
105     if (filter != null) {
106       if (!filter.isLiteralText()) {
107         component.setValueExpression("filter", filter);
108       } else {
109         component.setFilter(org.apache.myfaces.tobago.model.SuggestFilter.parse(filter.getExpressionString()));
110       }
111     }
112   }
113 
114   public javax.el.ValueExpression getUpdate() {
115     return update;
116   }
117 
118   public void setUpdate(final javax.el.ValueExpression update) {
119     this.update = update;
120   }
121 
122   public javax.el.ValueExpression getMaximumItems() {
123     return maximumItems;
124   }
125 
126   public void setMaximumItems(final javax.el.ValueExpression maximumItems) {
127     this.maximumItems = maximumItems;
128   }
129 
130   public javax.el.MethodExpression getSuggestMethod() {
131     return suggestMethod;
132   }
133 
134   public void setSuggestMethod(final javax.el.MethodExpression suggestMethod) {
135     this.suggestMethod = suggestMethod;
136   }
137 
138   public javax.el.ValueExpression getMarkup() {
139     return markup;
140   }
141 
142   public void setMarkup(final javax.el.ValueExpression markup) {
143     this.markup = markup;
144   }
145 
146   public javax.el.ValueExpression getTotalCount() {
147     return totalCount;
148   }
149 
150   public void setTotalCount(final javax.el.ValueExpression totalCount) {
151     this.totalCount = totalCount;
152   }
153 
154   public javax.el.ValueExpression getMinimumCharacters() {
155     return minimumCharacters;
156   }
157 
158   public void setMinimumCharacters(final javax.el.ValueExpression minimumCharacters) {
159     this.minimumCharacters = minimumCharacters;
160   }
161 
162   public javax.el.ValueExpression getDelay() {
163     return delay;
164   }
165 
166   public void setDelay(final javax.el.ValueExpression delay) {
167     this.delay = delay;
168   }
169 
170   public javax.el.ValueExpression getFilter() {
171     return filter;
172   }
173 
174   public void setFilter(final javax.el.ValueExpression filter) {
175     this.filter = filter;
176   }
177 
178 
179 
180   @Override
181   public void release() {
182     super.release();
183     update = null;
184     maximumItems = null;
185     suggestMethod = null;
186     markup = null;
187     totalCount = null;
188     minimumCharacters = null;
189     delay = null;
190     filter = null;
191   }
192 }