1 /**
2 * Licensed under the Artistic License; you may not use this file
3 * except in compliance with the License.
4 * You may obtain a copy of the License at
5 *
6 * http://displaytag.sourceforge.net/license.html
7 *
8 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
9 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
10 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 */
12 package org.displaytag.tags.el;
13
14 import java.beans.IntrospectionException;
15 import java.beans.PropertyDescriptor;
16 import java.beans.SimpleBeanInfo;
17 import java.util.ArrayList;
18 import java.util.List;
19
20 import org.apache.commons.lang.UnhandledException;
21
22
23 /**
24 * BeanInfo descriptor for the <code>ELColumnTag</code> class. Unevaluated EL expression has to be kept separately
25 * from the evaluated value, since the JSP compiler can choose to reuse different tag instances if they received the
26 * same original attribute values, and the JSP compiler can choose to not re-call the setter methods.
27 * @author Fabrizio Giustina
28 * @version $Revision: 1081 $ ($Author: fgiust $)
29 */
30 public class ELColumnTagBeanInfo extends SimpleBeanInfo
31 {
32
33 /**
34 * @see java.beans.BeanInfo#getPropertyDescriptors()
35 */
36 public PropertyDescriptor[] getPropertyDescriptors()
37 {
38 List proplist = new ArrayList();
39
40 try
41 {
42 proplist.add(new PropertyDescriptor("autolink", //$NON-NLS-1$
43 ELColumnTag.class,
44 null,
45 "setAutolink")); //$NON-NLS-1$
46 proplist.add(new PropertyDescriptor("escapeXml", //$NON-NLS-1$
47 ELColumnTag.class,
48 null,
49 "setEscapeXml")); //$NON-NLS-1$
50 proplist.add(new PropertyDescriptor("class", //$NON-NLS-1$
51 ELColumnTag.class,
52 null,
53 "setClass")); //$NON-NLS-1$
54 proplist.add(new PropertyDescriptor("decorator", //$NON-NLS-1$
55 ELColumnTag.class,
56 null,
57 "setDecorator")); //$NON-NLS-1$
58 proplist.add(new PropertyDescriptor("group", //$NON-NLS-1$
59 ELColumnTag.class,
60 null,
61 "setGroup")); //$NON-NLS-1$
62 proplist.add(new PropertyDescriptor("headerClass", //$NON-NLS-1$
63 ELColumnTag.class,
64 null,
65 "setHeaderClass")); //$NON-NLS-1$
66 proplist.add(new PropertyDescriptor("href", //$NON-NLS-1$
67 ELColumnTag.class,
68 null,
69 "setHref")); //$NON-NLS-1$
70 proplist.add(new PropertyDescriptor("maxLength", //$NON-NLS-1$
71 ELColumnTag.class,
72 null,
73 "setMaxLength")); //$NON-NLS-1$
74 proplist.add(new PropertyDescriptor("maxWords", //$NON-NLS-1$
75 ELColumnTag.class,
76 null,
77 "setMaxWords")); //$NON-NLS-1$
78 proplist.add(new PropertyDescriptor("media", //$NON-NLS-1$
79 ELColumnTag.class,
80 null,
81 "setMedia")); //$NON-NLS-1$
82 proplist.add(new PropertyDescriptor("nulls", //$NON-NLS-1$
83 ELColumnTag.class,
84 null,
85 "setNulls")); //$NON-NLS-1$
86 proplist.add(new PropertyDescriptor("paramId", //$NON-NLS-1$
87 ELColumnTag.class,
88 null,
89 "setParamId")); //$NON-NLS-1$
90 proplist.add(new PropertyDescriptor("paramName", //$NON-NLS-1$
91 ELColumnTag.class,
92 null,
93 "setParamName")); //$NON-NLS-1$
94 proplist.add(new PropertyDescriptor("paramProperty", //$NON-NLS-1$
95 ELColumnTag.class,
96 null,
97 "setParamProperty")); //$NON-NLS-1$
98 proplist.add(new PropertyDescriptor("paramScope", //$NON-NLS-1$
99 ELColumnTag.class,
100 null,
101 "setParamScope")); //$NON-NLS-1$
102 proplist.add(new PropertyDescriptor("property", //$NON-NLS-1$
103 ELColumnTag.class,
104 null,
105 "setProperty")); //$NON-NLS-1$
106 proplist.add(new PropertyDescriptor("sortable", //$NON-NLS-1$
107 ELColumnTag.class,
108 null,
109 "setSortable")); //$NON-NLS-1$
110 proplist.add(new PropertyDescriptor("sortName", //$NON-NLS-1$
111 ELColumnTag.class,
112 null,
113 "setSortName")); //$NON-NLS-1$
114 proplist.add(new PropertyDescriptor("style", //$NON-NLS-1$
115 ELColumnTag.class,
116 null,
117 "setStyle")); //$NON-NLS-1$
118 proplist.add(new PropertyDescriptor("total", //$NON-NLS-1$
119 ELColumnTag.class,
120 null,
121 "setTotal")); // map //$NON-NLS-1$
122 proplist.add(new PropertyDescriptor("title", //$NON-NLS-1$
123 ELColumnTag.class,
124 null,
125 "setTitle")); //$NON-NLS-1$
126 proplist.add(new PropertyDescriptor("titleKey", //$NON-NLS-1$
127 ELColumnTag.class,
128 null,
129 "setTitleKey")); //$NON-NLS-1$
130 proplist.add(new PropertyDescriptor("url", //$NON-NLS-1$
131 ELColumnTag.class,
132 null,
133 "setUrl")); //$NON-NLS-1$
134 proplist.add(new PropertyDescriptor("sortProperty", //$NON-NLS-1$
135 ELColumnTag.class,
136 null,
137 "setSortProperty")); //$NON-NLS-1$
138 proplist.add(new PropertyDescriptor("comparator", //$NON-NLS-1$
139 ELColumnTag.class,
140 null,
141 "setComparator")); //$NON-NLS-1$
142 proplist.add(new PropertyDescriptor("defaultorder", //$NON-NLS-1$
143 ELColumnTag.class,
144 null,
145 "setDefaultorder")); //$NON-NLS-1$
146 proplist.add(new PropertyDescriptor("headerScope", //$NON-NLS-1$
147 ELColumnTag.class,
148 null,
149 "setHeaderScope")); //$NON-NLS-1$
150 proplist.add(new PropertyDescriptor("scope", //$NON-NLS-1$
151 ELColumnTag.class,
152 null,
153 "setScope")); //$NON-NLS-1$
154 proplist.add(new PropertyDescriptor("format", //$NON-NLS-1$
155 ELColumnTag.class,
156 null,
157 "setFormat")); //$NON-NLS-1$
158 proplist.add(new PropertyDescriptor("value", //$NON-NLS-1$
159 ELColumnTag.class,
160 null,
161 "setValue")); //$NON-NLS-1$
162
163 }
164 catch (IntrospectionException ex)
165 {
166 throw new UnhandledException("You got an introspection exception - maybe defining a property that is not"
167 + " defined in the bean?: "
168 + ex.getMessage(), ex);
169 }
170
171 PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()];
172 return ((PropertyDescriptor[]) proplist.toArray(result));
173 }
174
175 }