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.logic.ELMessagesNotPresentTag</code>
29 * class. It is needed to override the default mapping of custom tag
30 * attribute names to class attribute names. <p> This is because the value of
31 * the unevaluated EL expression has to be kept separately from the evaluated
32 * value, which is stored in the base class. This is related to the fact that
33 * the JSP compiler can choose to reuse different tag instances if they
34 * received the same original attribute values, and the JSP compiler can
35 * choose to not re-call the setter methods, because it can assume the same
36 * values are already set.
37 */
38 public class ELMessagesNotPresentTagBeanInfo extends SimpleBeanInfo {
39 public PropertyDescriptor[] getPropertyDescriptors() {
40 ArrayList proplist = new ArrayList();
41
42 try {
43 proplist.add(new PropertyDescriptor("name",
44 ELMessagesNotPresentTag.class, null, "setNameExpr"));
45 } catch (IntrospectionException ex) {
46 }
47
48 try {
49 proplist.add(new PropertyDescriptor("property",
50 ELMessagesNotPresentTag.class, null, "setPropertyExpr"));
51 } catch (IntrospectionException ex) {
52 }
53
54 try {
55 proplist.add(new PropertyDescriptor("message",
56 ELMessagesNotPresentTag.class, null, "setMessageExpr"));
57 } catch (IntrospectionException ex) {
58 }
59
60 PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()];
61
62 return ((PropertyDescriptor[]) proplist.toArray(result));
63 }
64 }