View Javadoc

1   /*
2    * $Id: ELResetTagBeanInfo.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.ELResetTag</code> class.  It is
29   * needed to override the default mapping of custom tag attribute names to
30   * class attribute names. <p> In particular, it provides for the mapping of
31   * the custom tag attribute <code>disabled</code> to the instance variable
32   * <code>disabledExpr</code>. <p> This is because the value of the unevaluated
33   * EL expression has to be kept separately from the evaluated value, which is
34   * stored in the base class. This is related to the fact that the JSP compiler
35   * can choose to reuse different tag instances if they received the same
36   * original attribute values, and the JSP compiler can choose to not re-call
37   * the setter methods, because it can assume the same values are already set.
38   */
39  public class ELResetTagBeanInfo extends SimpleBeanInfo {
40      public PropertyDescriptor[] getPropertyDescriptors() {
41          ArrayList proplist = new ArrayList();
42  
43          try {
44              proplist.add(new PropertyDescriptor("accesskey", ELResetTag.class,
45                      null, "setAccesskeyExpr"));
46          } catch (IntrospectionException ex) {
47          }
48  
49          try {
50              proplist.add(new PropertyDescriptor("alt", ELResetTag.class, null,
51                      "setAltExpr"));
52          } catch (IntrospectionException ex) {
53          }
54  
55          try {
56              proplist.add(new PropertyDescriptor("altKey", ELResetTag.class,
57                      null, "setAltKeyExpr"));
58          } catch (IntrospectionException ex) {
59          }
60  
61          try {
62              proplist.add(new PropertyDescriptor("bundle", ELResetTag.class,
63                      null, "setBundleExpr"));
64          } catch (IntrospectionException ex) {
65          }
66  
67          try {
68              proplist.add(new PropertyDescriptor("disabled", ELResetTag.class,
69                      null, "setDisabledExpr"));
70          } catch (IntrospectionException ex) {
71          }
72  
73          try {
74              proplist.add(new PropertyDescriptor("onblur", ELResetTag.class,
75                      null, "setOnblurExpr"));
76          } catch (IntrospectionException ex) {
77          }
78  
79          try {
80              proplist.add(new PropertyDescriptor("onchange", ELResetTag.class,
81                      null, "setOnchangeExpr"));
82          } catch (IntrospectionException ex) {
83          }
84  
85          try {
86              proplist.add(new PropertyDescriptor("onclick", ELResetTag.class,
87                      null, "setOnclickExpr"));
88          } catch (IntrospectionException ex) {
89          }
90  
91          try {
92              proplist.add(new PropertyDescriptor("ondblclick", ELResetTag.class,
93                      null, "setOndblclickExpr"));
94          } catch (IntrospectionException ex) {
95          }
96  
97          try {
98              proplist.add(new PropertyDescriptor("onfocus", ELResetTag.class,
99                      null, "setOnfocusExpr"));
100         } catch (IntrospectionException ex) {
101         }
102 
103         try {
104             proplist.add(new PropertyDescriptor("onkeydown", ELResetTag.class,
105                     null, "setOnkeydownExpr"));
106         } catch (IntrospectionException ex) {
107         }
108 
109         try {
110             proplist.add(new PropertyDescriptor("onkeypress", ELResetTag.class,
111                     null, "setOnkeypressExpr"));
112         } catch (IntrospectionException ex) {
113         }
114 
115         try {
116             proplist.add(new PropertyDescriptor("onkeyup", ELResetTag.class,
117                     null, "setOnkeyupExpr"));
118         } catch (IntrospectionException ex) {
119         }
120 
121         try {
122             proplist.add(new PropertyDescriptor("onmousedown",
123                     ELResetTag.class, null, "setOnmousedownExpr"));
124         } catch (IntrospectionException ex) {
125         }
126 
127         try {
128             proplist.add(new PropertyDescriptor("onmousemove",
129                     ELResetTag.class, null, "setOnmousemoveExpr"));
130         } catch (IntrospectionException ex) {
131         }
132 
133         try {
134             proplist.add(new PropertyDescriptor("onmouseout", ELResetTag.class,
135                     null, "setOnmouseoutExpr"));
136         } catch (IntrospectionException ex) {
137         }
138 
139         try {
140             proplist.add(new PropertyDescriptor("onmouseover",
141                     ELResetTag.class, null, "setOnmouseoverExpr"));
142         } catch (IntrospectionException ex) {
143         }
144 
145         try {
146             proplist.add(new PropertyDescriptor("onmouseup", ELResetTag.class,
147                     null, "setOnmouseupExpr"));
148         } catch (IntrospectionException ex) {
149         }
150 
151         try {
152             proplist.add(new PropertyDescriptor("property", ELResetTag.class,
153                     null, "setPropertyExpr"));
154         } catch (IntrospectionException ex) {
155         }
156 
157         try {
158             proplist.add(new PropertyDescriptor("style", ELResetTag.class,
159                     null, "setStyleExpr"));
160         } catch (IntrospectionException ex) {
161         }
162 
163         try {
164             proplist.add(new PropertyDescriptor("styleClass", ELResetTag.class,
165                     null, "setStyleClassExpr"));
166         } catch (IntrospectionException ex) {
167         }
168 
169         try {
170             proplist.add(new PropertyDescriptor("styleId", ELResetTag.class,
171                     null, "setStyleIdExpr"));
172         } catch (IntrospectionException ex) {
173         }
174 
175         try {
176             proplist.add(new PropertyDescriptor("tabindex", ELResetTag.class,
177                     null, "setTabindexExpr"));
178         } catch (IntrospectionException ex) {
179         }
180 
181         try {
182             proplist.add(new PropertyDescriptor("title", ELResetTag.class,
183                     null, "setTitleExpr"));
184         } catch (IntrospectionException ex) {
185         }
186 
187         try {
188             proplist.add(new PropertyDescriptor("titleKey", ELResetTag.class,
189                     null, "setTitleKeyExpr"));
190         } catch (IntrospectionException ex) {
191         }
192 
193         try {
194             proplist.add(new PropertyDescriptor("value", ELResetTag.class,
195                     null, "setValueExpr"));
196         } catch (IntrospectionException ex) {
197         }
198 
199         PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()];
200 
201         return ((PropertyDescriptor[]) proplist.toArray(result));
202     }
203 }