KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > strutsel > taglib > html > ELJavascriptValidatorTagBeanInfo


1 /*
2  * $Id: ELJavascriptValidatorTagBeanInfo.java 160033 2005-04-04 12:06:45Z niallp $
3  *
4  * Copyright 1999-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 package org.apache.strutsel.taglib.html;
20
21 import java.beans.PropertyDescriptor JavaDoc;
22 import java.beans.IntrospectionException JavaDoc;
23 import java.util.ArrayList JavaDoc;
24 import java.beans.SimpleBeanInfo JavaDoc;
25
26 /**
27  * This is the <code>BeanInfo</code> descriptor for the
28  * <code>org.apache.strutsel.taglib.html.ELJavascriptValidatorTag</code> class.
29  * It is needed to override the default mapping of custom tag attribute names
30  * to class attribute names.
31  *<p>
32  * This is because the value of the unevaluated EL expression has to be kept
33  * separately from the evaluated value, which is stored in the base class. This
34  * is related to the fact that the JSP compiler can choose to reuse different
35  * tag instances if they received the same original attribute values, and the
36  * JSP compiler can choose to not re-call the setter methods, because it can
37  * assume the same values are already set.
38  */

39 public class ELJavascriptValidatorTagBeanInfo extends SimpleBeanInfo JavaDoc
40 {
41     public PropertyDescriptor JavaDoc[] getPropertyDescriptors()
42     {
43         ArrayList JavaDoc proplist = new ArrayList JavaDoc();
44
45         try {
46             proplist.add(new PropertyDescriptor JavaDoc("cdata", ELJavascriptValidatorTag.class,
47                                                 null, "setCdataExpr"));
48         } catch (IntrospectionException JavaDoc ex) {}
49         try {
50             proplist.add(new PropertyDescriptor JavaDoc("dynamicJavascript", ELJavascriptValidatorTag.class,
51                                                 null, "setDynamicJavascriptExpr"));
52         } catch (IntrospectionException JavaDoc ex) {}
53         try {
54             proplist.add(new PropertyDescriptor JavaDoc("formName", ELJavascriptValidatorTag.class,
55                                                 null, "setFormNameExpr"));
56         } catch (IntrospectionException JavaDoc ex) {}
57         try {
58             proplist.add(new PropertyDescriptor JavaDoc("method", ELJavascriptValidatorTag.class,
59                                                 null, "setMethodExpr"));
60         } catch (IntrospectionException JavaDoc ex) {}
61         try {
62             proplist.add(new PropertyDescriptor JavaDoc("page", ELJavascriptValidatorTag.class,
63                                                 null, "setPageExpr"));
64         } catch (IntrospectionException JavaDoc ex) {}
65         try {
66             proplist.add(new PropertyDescriptor JavaDoc("scriptLanguage", ELJavascriptValidatorTag.class,
67                                                 null, "setScriptLanguageExpr"));
68         } catch (IntrospectionException JavaDoc ex) {}
69         try {
70             proplist.add(new PropertyDescriptor JavaDoc("src", ELJavascriptValidatorTag.class,
71                                                 null, "setSrcExpr"));
72         } catch (IntrospectionException JavaDoc ex) {}
73         try {
74             proplist.add(new PropertyDescriptor JavaDoc("staticJavascript", ELJavascriptValidatorTag.class,
75                                                 null, "setStaticJavascriptExpr"));
76         } catch (IntrospectionException JavaDoc ex) {}
77         try {
78             proplist.add(new PropertyDescriptor JavaDoc("htmlComment", ELJavascriptValidatorTag.class,
79                                                 null, "setHtmlCommentExpr"));
80         } catch (IntrospectionException JavaDoc ex) {}
81         try {
82             proplist.add(new PropertyDescriptor JavaDoc("bundle", ELJavascriptValidatorTag.class,
83                                                 null, "setBundleExpr"));
84         } catch (IntrospectionException JavaDoc ex) {}
85         
86         PropertyDescriptor JavaDoc[] result =
87             new PropertyDescriptor JavaDoc[proplist.size()];
88         return ((PropertyDescriptor JavaDoc[]) proplist.toArray(result));
89     }
90 }
91
Popular Tags