View Javadoc

1   /*
2    * $Id: ELLinkTagBeanInfo.java 376779 2006-02-10 18:08:58Z husted $
3    *
4    * Copyright 1999-2004 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.strutsel.taglib.html;
19  
20  import java.beans.IntrospectionException;
21  import java.beans.PropertyDescriptor;
22  import java.beans.SimpleBeanInfo;
23  
24  import java.util.ArrayList;
25  
26  /***
27   * This is the <code>BeanInfo</code> descriptor for the
28   * <code>org.apache.strutsel.taglib.html.ELLinkTag</code> class.  It is needed
29   * to override the default mapping of custom tag attribute names to class
30   * attribute names. <p> This is because the value of the unevaluated EL
31   * expression has to be kept separately from the evaluated value, which is
32   * stored in the base class. This is related to the fact that the JSP compiler
33   * can choose to reuse different tag instances if they received the same
34   * original attribute values, and the JSP compiler can choose to not re-call
35   * the setter methods, because it can assume the same values are already set.
36   */
37  public class ELLinkTagBeanInfo extends SimpleBeanInfo {
38      public PropertyDescriptor[] getPropertyDescriptors() {
39          ArrayList proplist = new ArrayList();
40  
41          try {
42              proplist.add(new PropertyDescriptor("accesskey", ELLinkTag.class,
43                      null, "setAccesskeyExpr"));
44          } catch (IntrospectionException ex) {
45          }
46  
47          try {
48              proplist.add(new PropertyDescriptor("action", ELLinkTag.class,
49                      null, "setActionExpr"));
50          } catch (IntrospectionException ex) {
51          }
52  
53          try {
54              proplist.add(new PropertyDescriptor("module", ELLinkTag.class,
55                      null, "setModuleExpr"));
56          } catch (IntrospectionException ex) {
57          }
58  
59          try {
60              proplist.add(new PropertyDescriptor("anchor", ELLinkTag.class,
61                      null, "setAnchorExpr"));
62          } catch (IntrospectionException ex) {
63          }
64  
65          try {
66              proplist.add(new PropertyDescriptor("bundle", ELLinkTag.class,
67                      null, "setBundleExpr"));
68          } catch (IntrospectionException ex) {
69          }
70  
71          try {
72              proplist.add(new PropertyDescriptor("forward", ELLinkTag.class,
73                      null, "setForwardExpr"));
74          } catch (IntrospectionException ex) {
75          }
76  
77          try {
78              proplist.add(new PropertyDescriptor("href", ELLinkTag.class, null,
79                      "setHrefExpr"));
80          } catch (IntrospectionException ex) {
81          }
82  
83          try {
84              proplist.add(new PropertyDescriptor("indexed", ELLinkTag.class,
85                      null, "setIndexedExpr"));
86          } catch (IntrospectionException ex) {
87          }
88  
89          try {
90              proplist.add(new PropertyDescriptor("indexId", ELLinkTag.class,
91                      null, "setIndexIdExpr"));
92          } catch (IntrospectionException ex) {
93          }
94  
95          try {
96              proplist.add(new PropertyDescriptor("linkName", ELLinkTag.class,
97                      null, "setLinkNameExpr"));
98          } catch (IntrospectionException ex) {
99          }
100 
101         try {
102             proplist.add(new PropertyDescriptor("name", ELLinkTag.class, null,
103                     "setNameExpr"));
104         } catch (IntrospectionException ex) {
105         }
106 
107         try {
108             proplist.add(new PropertyDescriptor("onblur", ELLinkTag.class,
109                     null, "setOnblurExpr"));
110         } catch (IntrospectionException ex) {
111         }
112 
113         try {
114             proplist.add(new PropertyDescriptor("onclick", ELLinkTag.class,
115                     null, "setOnclickExpr"));
116         } catch (IntrospectionException ex) {
117         }
118 
119         try {
120             proplist.add(new PropertyDescriptor("ondblclick", ELLinkTag.class,
121                     null, "setOndblclickExpr"));
122         } catch (IntrospectionException ex) {
123         }
124 
125         try {
126             proplist.add(new PropertyDescriptor("onfocus", ELLinkTag.class,
127                     null, "setOnfocusExpr"));
128         } catch (IntrospectionException ex) {
129         }
130 
131         try {
132             proplist.add(new PropertyDescriptor("onkeydown", ELLinkTag.class,
133                     null, "setOnkeydownExpr"));
134         } catch (IntrospectionException ex) {
135         }
136 
137         try {
138             proplist.add(new PropertyDescriptor("onkeypress", ELLinkTag.class,
139                     null, "setOnkeypressExpr"));
140         } catch (IntrospectionException ex) {
141         }
142 
143         try {
144             proplist.add(new PropertyDescriptor("onkeyup", ELLinkTag.class,
145                     null, "setOnkeyupExpr"));
146         } catch (IntrospectionException ex) {
147         }
148 
149         try {
150             proplist.add(new PropertyDescriptor("onmousedown", ELLinkTag.class,
151                     null, "setOnmousedownExpr"));
152         } catch (IntrospectionException ex) {
153         }
154 
155         try {
156             proplist.add(new PropertyDescriptor("onmousemove", ELLinkTag.class,
157                     null, "setOnmousemoveExpr"));
158         } catch (IntrospectionException ex) {
159         }
160 
161         try {
162             proplist.add(new PropertyDescriptor("onmouseout", ELLinkTag.class,
163                     null, "setOnmouseoutExpr"));
164         } catch (IntrospectionException ex) {
165         }
166 
167         try {
168             proplist.add(new PropertyDescriptor("onmouseover", ELLinkTag.class,
169                     null, "setOnmouseoverExpr"));
170         } catch (IntrospectionException ex) {
171         }
172 
173         try {
174             proplist.add(new PropertyDescriptor("onmouseup", ELLinkTag.class,
175                     null, "setOnmouseupExpr"));
176         } catch (IntrospectionException ex) {
177         }
178 
179         try {
180             proplist.add(new PropertyDescriptor("page", ELLinkTag.class, null,
181                     "setPageExpr"));
182         } catch (IntrospectionException ex) {
183         }
184 
185         try {
186             proplist.add(new PropertyDescriptor("paramId", ELLinkTag.class,
187                     null, "setParamIdExpr"));
188         } catch (IntrospectionException ex) {
189         }
190 
191         try {
192             proplist.add(new PropertyDescriptor("paramName", ELLinkTag.class,
193                     null, "setParamNameExpr"));
194         } catch (IntrospectionException ex) {
195         }
196 
197         try {
198             proplist.add(new PropertyDescriptor("paramProperty",
199                     ELLinkTag.class, null, "setParamPropertyExpr"));
200         } catch (IntrospectionException ex) {
201         }
202 
203         try {
204             proplist.add(new PropertyDescriptor("paramScope", ELLinkTag.class,
205                     null, "setParamScopeExpr"));
206         } catch (IntrospectionException ex) {
207         }
208 
209         try {
210             proplist.add(new PropertyDescriptor("property", ELLinkTag.class,
211                     null, "setPropertyExpr"));
212         } catch (IntrospectionException ex) {
213         }
214 
215         try {
216             proplist.add(new PropertyDescriptor("scope", ELLinkTag.class, null,
217                     "setScopeExpr"));
218         } catch (IntrospectionException ex) {
219         }
220 
221         try {
222             proplist.add(new PropertyDescriptor("style", ELLinkTag.class, null,
223                     "setStyleExpr"));
224         } catch (IntrospectionException ex) {
225         }
226 
227         try {
228             proplist.add(new PropertyDescriptor("styleClass", ELLinkTag.class,
229                     null, "setStyleClassExpr"));
230         } catch (IntrospectionException ex) {
231         }
232 
233         try {
234             proplist.add(new PropertyDescriptor("styleId", ELLinkTag.class,
235                     null, "setStyleIdExpr"));
236         } catch (IntrospectionException ex) {
237         }
238 
239         try {
240             proplist.add(new PropertyDescriptor("tabindex", ELLinkTag.class,
241                     null, "setTabindexExpr"));
242         } catch (IntrospectionException ex) {
243         }
244 
245         try {
246             proplist.add(new PropertyDescriptor("target", ELLinkTag.class,
247                     null, "setTargetExpr"));
248         } catch (IntrospectionException ex) {
249         }
250 
251         try {
252             proplist.add(new PropertyDescriptor("title", ELLinkTag.class, null,
253                     "setTitleExpr"));
254         } catch (IntrospectionException ex) {
255         }
256 
257         try {
258             proplist.add(new PropertyDescriptor("titleKey", ELLinkTag.class,
259                     null, "setTitleKeyExpr"));
260         } catch (IntrospectionException ex) {
261         }
262 
263         try {
264             proplist.add(new PropertyDescriptor("transaction", ELLinkTag.class,
265                     null, "setTransactionExpr"));
266         } catch (IntrospectionException ex) {
267         }
268 
269         try {
270             proplist.add(new PropertyDescriptor("useLocalEncoding",
271                     ELLinkTag.class, null, "setUseLocalEncodingExpr"));
272         } catch (IntrospectionException ex) {
273         }
274 
275         PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()];
276 
277         return ((PropertyDescriptor[]) proplist.toArray(result));
278     }
279 }