~ubuntu-branches/ubuntu/trusty/libstruts1.2-java/trusty-proposed

« back to all changes in this revision

Viewing changes to contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELRewriteTagBeanInfo.java

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2004-11-19 15:35:25 UTC
  • Revision ID: james.westby@ubuntu.com-20041119153525-mdu08a76z4zo67xt
Tags: upstream-1.2.4
ImportĀ upstreamĀ versionĀ 1.2.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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 $
 
3
 * $Revision: 1.7 $
 
4
 * $Date: 2004/03/14 07:15:01 $
 
5
 *
 
6
 * Copyright 1999-2004 The Apache Software Foundation.
 
7
 * 
 
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
 
11
 * 
 
12
 *      http://www.apache.org/licenses/LICENSE-2.0
 
13
 * 
 
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.
 
19
 */
 
20
 
 
21
package org.apache.strutsel.taglib.html;
 
22
 
 
23
import java.beans.PropertyDescriptor;
 
24
import java.beans.IntrospectionException;
 
25
import java.util.ArrayList;
 
26
import java.beans.SimpleBeanInfo;
 
27
 
 
28
/**
 
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.
 
33
 *<p>
 
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.
 
40
 */
 
41
public class ELRewriteTagBeanInfo extends SimpleBeanInfo
 
42
{
 
43
    public  PropertyDescriptor[] getPropertyDescriptors()
 
44
    {
 
45
        ArrayList proplist = new ArrayList();
 
46
 
 
47
        try {
 
48
            proplist.add(new PropertyDescriptor("action", ELRewriteTag.class,
 
49
                                                null, "setActionExpr"));
 
50
        } catch (IntrospectionException ex) {}
 
51
        try {
 
52
            proplist.add(new PropertyDescriptor("module", ELRewriteTag.class,
 
53
                                                null, "setModuleExpr"));
 
54
        } catch (IntrospectionException ex) {}
 
55
        try {
 
56
            proplist.add(new PropertyDescriptor("anchor", ELRewriteTag.class,
 
57
                                                null, "setAnchorExpr"));
 
58
        } catch (IntrospectionException ex) {}
 
59
        try {
 
60
            proplist.add(new PropertyDescriptor("forward", ELRewriteTag.class,
 
61
                                                null, "setForwardExpr"));
 
62
        } catch (IntrospectionException ex) {}
 
63
        try {
 
64
            proplist.add(new PropertyDescriptor("href", ELRewriteTag.class,
 
65
                                                null, "setHrefExpr"));
 
66
        } catch (IntrospectionException ex) {}
 
67
        try {
 
68
            proplist.add(new PropertyDescriptor("name", ELRewriteTag.class,
 
69
                                                null, "setNameExpr"));
 
70
        } catch (IntrospectionException ex) {}
 
71
        try {
 
72
            proplist.add(new PropertyDescriptor("page", ELRewriteTag.class,
 
73
                                                null, "setPageExpr"));
 
74
        } catch (IntrospectionException ex) {}
 
75
        try {
 
76
            proplist.add(new PropertyDescriptor("paramId", ELRewriteTag.class,
 
77
                                                null, "setParamIdExpr"));
 
78
        } catch (IntrospectionException ex) {}
 
79
        try {
 
80
            proplist.add(new PropertyDescriptor("paramName", ELRewriteTag.class,
 
81
                                                null, "setParamNameExpr"));
 
82
        } catch (IntrospectionException ex) {}
 
83
        try {
 
84
            proplist.add(new PropertyDescriptor("paramProperty", ELRewriteTag.class,
 
85
                                                null, "setParamPropertyExpr"));
 
86
        } catch (IntrospectionException ex) {}
 
87
        try {
 
88
            proplist.add(new PropertyDescriptor("paramScope", ELRewriteTag.class,
 
89
                                                null, "setParamScopeExpr"));
 
90
        } catch (IntrospectionException ex) {}
 
91
        try {
 
92
            proplist.add(new PropertyDescriptor("property", ELRewriteTag.class,
 
93
                                                null, "setPropertyExpr"));
 
94
        } catch (IntrospectionException ex) {}
 
95
        try {
 
96
            proplist.add(new PropertyDescriptor("scope", ELRewriteTag.class,
 
97
                                                null, "setScopeExpr"));
 
98
        } catch (IntrospectionException ex) {}
 
99
        try {
 
100
            proplist.add(new PropertyDescriptor("transaction", ELRewriteTag.class,
 
101
                                                null, "setTransactionExpr"));
 
102
        } catch (IntrospectionException ex) {}
 
103
        try {
 
104
            proplist.add(new PropertyDescriptor("useLocalEncoding", ELRewriteTag.class,
 
105
                                                null, "setUseLocalEncodingExpr"));
 
106
        } catch (IntrospectionException ex) {}
 
107
        
 
108
        PropertyDescriptor[] result =
 
109
            new PropertyDescriptor[proplist.size()];
 
110
        return ((PropertyDescriptor[]) proplist.toArray(result));
 
111
    }
 
112
}