1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.strutsel.taglib.logic;
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.bean.ELIterateTag</code> class. It is
29 * needed to override the default mapping of custom tag attribute names to
30 * class 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 ELIterateTagBeanInfo extends SimpleBeanInfo {
38 public PropertyDescriptor[] getPropertyDescriptors() {
39 ArrayList proplist = new ArrayList();
40
41 try {
42 proplist.add(new PropertyDescriptor("collection",
43 ELIterateTag.class, null, "setCollectionExpr"));
44 } catch (IntrospectionException ex) {
45 }
46
47 try {
48 proplist.add(new PropertyDescriptor("id", ELIterateTag.class, null,
49 "setIdExpr"));
50 } catch (IntrospectionException ex) {
51 }
52
53 try {
54 proplist.add(new PropertyDescriptor("indexId", ELIterateTag.class,
55 null, "setIndexIdExpr"));
56 } catch (IntrospectionException ex) {
57 }
58
59 try {
60 proplist.add(new PropertyDescriptor("length", ELIterateTag.class,
61 null, "setLengthExpr"));
62 } catch (IntrospectionException ex) {
63 }
64
65 try {
66 proplist.add(new PropertyDescriptor("name", ELIterateTag.class,
67 null, "setNameExpr"));
68 } catch (IntrospectionException ex) {
69 }
70
71 try {
72 proplist.add(new PropertyDescriptor("offset", ELIterateTag.class,
73 null, "setOffsetExpr"));
74 } catch (IntrospectionException ex) {
75 }
76
77 try {
78 proplist.add(new PropertyDescriptor("property", ELIterateTag.class,
79 null, "setPropertyExpr"));
80 } catch (IntrospectionException ex) {
81 }
82
83 try {
84 proplist.add(new PropertyDescriptor("scope", ELIterateTag.class,
85 null, "setScopeExpr"));
86 } catch (IntrospectionException ex) {
87 }
88
89 try {
90 proplist.add(new PropertyDescriptor("type", ELIterateTag.class,
91 null, "setTypeExpr"));
92 } catch (IntrospectionException ex) {
93 }
94
95 PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()];
96
97 return ((PropertyDescriptor[]) proplist.toArray(result));
98 }
99 }