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;
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>ColumnTag</code> class..
25 * @author Fabrizio Giustina
26 * @version $Revision: 1081 $ ($Author: fgiust $)
27 */
28 public class ColumnTagBeanInfo extends SimpleBeanInfo
29 {
30
31 /**
32 * @see java.beans.BeanInfo#getPropertyDescriptors()
33 */
34 public PropertyDescriptor[] getPropertyDescriptors()
35 {
36 List proplist = new ArrayList();
37
38 try
39 {
40 proplist.add(new PropertyDescriptor("autolink", //$NON-NLS-1$
41 ColumnTag.class,
42 null,
43 "setAutolink")); //$NON-NLS-1$
44 proplist.add(new PropertyDescriptor("escapeXml", //$NON-NLS-1$
45 ColumnTag.class,
46 null,
47 "setEscapeXml")); //$NON-NLS-1$
48 proplist.add(new PropertyDescriptor("class", //$NON-NLS-1$
49 ColumnTag.class,
50 null,
51 "setClass")); //$NON-NLS-1$
52 proplist.add(new PropertyDescriptor("decorator", //$NON-NLS-1$
53 ColumnTag.class,
54 null,
55 "setDecorator")); //$NON-NLS-1$
56 proplist.add(new PropertyDescriptor("group", //$NON-NLS-1$
57 ColumnTag.class,
58 null,
59 "setGroup")); //$NON-NLS-1$
60 proplist.add(new PropertyDescriptor("headerClass", //$NON-NLS-1$
61 ColumnTag.class,
62 null,
63 "setHeaderClass")); //$NON-NLS-1$
64 proplist.add(new PropertyDescriptor("href", //$NON-NLS-1$
65 ColumnTag.class,
66 null,
67 "setHref")); //$NON-NLS-1$
68 proplist.add(new PropertyDescriptor("maxLength", //$NON-NLS-1$
69 ColumnTag.class,
70 null,
71 "setMaxLength")); //$NON-NLS-1$
72 proplist.add(new PropertyDescriptor("maxWords", //$NON-NLS-1$
73 ColumnTag.class,
74 null,
75 "setMaxWords")); //$NON-NLS-1$
76 proplist.add(new PropertyDescriptor("media", //$NON-NLS-1$
77 ColumnTag.class,
78 null,
79 "setMedia")); //$NON-NLS-1$
80 proplist.add(new PropertyDescriptor("nulls", //$NON-NLS-1$
81 ColumnTag.class,
82 null,
83 "setNulls")); //$NON-NLS-1$
84 proplist.add(new PropertyDescriptor("paramId", //$NON-NLS-1$
85 ColumnTag.class,
86 null,
87 "setParamId")); //$NON-NLS-1$
88 proplist.add(new PropertyDescriptor("paramName", //$NON-NLS-1$
89 ColumnTag.class,
90 null,
91 "setParamName")); //$NON-NLS-1$
92 proplist.add(new PropertyDescriptor("paramProperty", //$NON-NLS-1$
93 ColumnTag.class,
94 null,
95 "setParamProperty")); //$NON-NLS-1$
96 proplist.add(new PropertyDescriptor("paramScope", //$NON-NLS-1$
97 ColumnTag.class,
98 null,
99 "setParamScope")); //$NON-NLS-1$
100 proplist.add(new PropertyDescriptor("property", //$NON-NLS-1$
101 ColumnTag.class,
102 null,
103 "setProperty")); //$NON-NLS-1$
104 proplist.add(new PropertyDescriptor("sortable", //$NON-NLS-1$
105 ColumnTag.class,
106 null,
107 "setSortable")); //$NON-NLS-1$
108 proplist.add(new PropertyDescriptor("sortName", //$NON-NLS-1$
109 ColumnTag.class,
110 null,
111 "setSortName")); //$NON-NLS-1$
112 proplist.add(new PropertyDescriptor("style", //$NON-NLS-1$
113 ColumnTag.class,
114 null,
115 "setStyle")); //$NON-NLS-1$
116 proplist.add(new PropertyDescriptor("title", //$NON-NLS-1$
117 ColumnTag.class,
118 null,
119 "setTitle")); //$NON-NLS-1$
120 proplist.add(new PropertyDescriptor("titleKey", //$NON-NLS-1$
121 ColumnTag.class,
122 null,
123 "setTitleKey")); //$NON-NLS-1$
124 proplist.add(new PropertyDescriptor("url", //$NON-NLS-1$
125 ColumnTag.class,
126 null,
127 "setUrl")); //$NON-NLS-1$
128 proplist.add(new PropertyDescriptor("sortProperty", //$NON-NLS-1$
129 ColumnTag.class,
130 null,
131 "setSortProperty")); //$NON-NLS-1$
132 proplist.add(new PropertyDescriptor("total", //$NON-NLS-1$
133 ColumnTag.class,
134 null,
135 "setTotal")); //$NON-NLS-1$
136 proplist.add(new PropertyDescriptor("comparator", //$NON-NLS-1$
137 ColumnTag.class,
138 null,
139 "setComparator")); //$NON-NLS-1$
140 proplist.add(new PropertyDescriptor("defaultorder", //$NON-NLS-1$
141 ColumnTag.class,
142 null,
143 "setDefaultorder")); //$NON-NLS-1$
144 proplist.add(new PropertyDescriptor("headerScope", //$NON-NLS-1$
145 ColumnTag.class,
146 null,
147 "setHeaderScope")); //$NON-NLS-1$
148 proplist.add(new PropertyDescriptor("scope", //$NON-NLS-1$
149 ColumnTag.class,
150 null,
151 "setScope")); //$NON-NLS-1$
152 proplist.add(new PropertyDescriptor("format", //$NON-NLS-1$
153 ColumnTag.class,
154 null,
155 "setFormat")); //$NON-NLS-1$
156 proplist.add(new PropertyDescriptor("value", //$NON-NLS-1$
157 ColumnTag.class,
158 null,
159 "setValue")); //$NON-NLS-1$
160
161 // make ATG Dynamo happy:
162 proplist.add(new PropertyDescriptor("className", //$NON-NLS-1$
163 ColumnTag.class,
164 null,
165 "setClass")); // map //$NON-NLS-1$
166
167 }
168 catch (IntrospectionException ex)
169 {
170 throw new UnhandledException("You got an introspection exception - maybe defining a property that is not"
171 + " defined in the ColumnTag?: "
172 + ex.getMessage(), ex);
173 }
174
175 PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()];
176 return ((PropertyDescriptor[]) proplist.toArray(result));
177 }
178
179 }