2
* $Header: /home/cvs/jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELRewriteTagBeanInfo.java,v 1.7 2004/03/14 07:15:01 sraeburn Exp $
4
* $Date: 2004/03/14 07:15:01 $
6
* Copyright 1999-2004 The Apache Software Foundation.
8
* Licensed under the Apache License, Version 2.0 (the "License");
9
* you may not use this file except in compliance with the License.
10
* You may obtain a copy of the License at
12
* http://www.apache.org/licenses/LICENSE-2.0
14
* Unless required by applicable law or agreed to in writing, software
15
* distributed under the License is distributed on an "AS IS" BASIS,
16
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
* See the License for the specific language governing permissions and
18
* limitations under the License.
21
package org.apache.strutsel.taglib.html;
23
import java.beans.PropertyDescriptor;
24
import java.beans.IntrospectionException;
25
import java.util.ArrayList;
26
import java.beans.SimpleBeanInfo;
29
* This is the <code>BeanInfo</code> descriptor for the
30
* <code>org.apache.strutsel.taglib.html.ELRewriteTag</code> class. It is
31
* needed to override the default mapping of custom tag attribute names to
32
* class attribute names.
34
* This is because the value of the unevaluated EL expression has to be kept
35
* separately from the evaluated value, which is stored in the base class. This
36
* is related to the fact that the JSP compiler can choose to reuse different
37
* tag instances if they received the same original attribute values, and the
38
* JSP compiler can choose to not re-call the setter methods, because it can
39
* assume the same values are already set.
41
public class ELRewriteTagBeanInfo extends SimpleBeanInfo
43
public PropertyDescriptor[] getPropertyDescriptors()
45
ArrayList proplist = new ArrayList();
48
proplist.add(new PropertyDescriptor("action", ELRewriteTag.class,
49
null, "setActionExpr"));
50
} catch (IntrospectionException ex) {}
52
proplist.add(new PropertyDescriptor("module", ELRewriteTag.class,
53
null, "setModuleExpr"));
54
} catch (IntrospectionException ex) {}
56
proplist.add(new PropertyDescriptor("anchor", ELRewriteTag.class,
57
null, "setAnchorExpr"));
58
} catch (IntrospectionException ex) {}
60
proplist.add(new PropertyDescriptor("forward", ELRewriteTag.class,
61
null, "setForwardExpr"));
62
} catch (IntrospectionException ex) {}
64
proplist.add(new PropertyDescriptor("href", ELRewriteTag.class,
65
null, "setHrefExpr"));
66
} catch (IntrospectionException ex) {}
68
proplist.add(new PropertyDescriptor("name", ELRewriteTag.class,
69
null, "setNameExpr"));
70
} catch (IntrospectionException ex) {}
72
proplist.add(new PropertyDescriptor("page", ELRewriteTag.class,
73
null, "setPageExpr"));
74
} catch (IntrospectionException ex) {}
76
proplist.add(new PropertyDescriptor("paramId", ELRewriteTag.class,
77
null, "setParamIdExpr"));
78
} catch (IntrospectionException ex) {}
80
proplist.add(new PropertyDescriptor("paramName", ELRewriteTag.class,
81
null, "setParamNameExpr"));
82
} catch (IntrospectionException ex) {}
84
proplist.add(new PropertyDescriptor("paramProperty", ELRewriteTag.class,
85
null, "setParamPropertyExpr"));
86
} catch (IntrospectionException ex) {}
88
proplist.add(new PropertyDescriptor("paramScope", ELRewriteTag.class,
89
null, "setParamScopeExpr"));
90
} catch (IntrospectionException ex) {}
92
proplist.add(new PropertyDescriptor("property", ELRewriteTag.class,
93
null, "setPropertyExpr"));
94
} catch (IntrospectionException ex) {}
96
proplist.add(new PropertyDescriptor("scope", ELRewriteTag.class,
97
null, "setScopeExpr"));
98
} catch (IntrospectionException ex) {}
100
proplist.add(new PropertyDescriptor("transaction", ELRewriteTag.class,
101
null, "setTransactionExpr"));
102
} catch (IntrospectionException ex) {}
104
proplist.add(new PropertyDescriptor("useLocalEncoding", ELRewriteTag.class,
105
null, "setUseLocalEncodingExpr"));
106
} catch (IntrospectionException ex) {}
108
PropertyDescriptor[] result =
109
new PropertyDescriptor[proplist.size()];
110
return ((PropertyDescriptor[]) proplist.toArray(result));