001: /*
002: * $Id: ELJavascriptValidatorTagBeanInfo.java 471754 2006-11-06 14:55:09Z husted $
003: *
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021: package org.apache.strutsel.taglib.html;
022:
023: import java.beans.IntrospectionException;
024: import java.beans.PropertyDescriptor;
025: import java.beans.SimpleBeanInfo;
026:
027: import java.util.ArrayList;
028:
029: /**
030: * This is the <code>BeanInfo</code> descriptor for the
031: * <code>org.apache.strutsel.taglib.html.ELJavascriptValidatorTag</code>
032: * class. It is needed to override the default mapping of custom tag attribute
033: * names to class attribute names. <p> This is because the value of the
034: * unevaluated EL expression has to be kept separately from the evaluated
035: * value, which is stored in the base class. This is related to the fact that
036: * the JSP compiler can choose to reuse different tag instances if they
037: * received the same original attribute values, and the JSP compiler can
038: * choose to not re-call the setter methods, because it can assume the same
039: * values are already set.
040: */
041: public class ELJavascriptValidatorTagBeanInfo extends SimpleBeanInfo {
042: public PropertyDescriptor[] getPropertyDescriptors() {
043: ArrayList proplist = new ArrayList();
044:
045: try {
046: proplist.add(new PropertyDescriptor("cdata",
047: ELJavascriptValidatorTag.class, null,
048: "setCdataExpr"));
049: } catch (IntrospectionException ex) {
050: }
051:
052: try {
053: proplist.add(new PropertyDescriptor("dynamicJavascript",
054: ELJavascriptValidatorTag.class, null,
055: "setDynamicJavascriptExpr"));
056: } catch (IntrospectionException ex) {
057: }
058:
059: try {
060: proplist.add(new PropertyDescriptor("formName",
061: ELJavascriptValidatorTag.class, null,
062: "setFormNameExpr"));
063: } catch (IntrospectionException ex) {
064: }
065:
066: try {
067: proplist.add(new PropertyDescriptor("method",
068: ELJavascriptValidatorTag.class, null,
069: "setMethodExpr"));
070: } catch (IntrospectionException ex) {
071: }
072:
073: try {
074: proplist
075: .add(new PropertyDescriptor("page",
076: ELJavascriptValidatorTag.class, null,
077: "setPageExpr"));
078: } catch (IntrospectionException ex) {
079: }
080:
081: try {
082: proplist.add(new PropertyDescriptor("scriptLanguage",
083: ELJavascriptValidatorTag.class, null,
084: "setScriptLanguageExpr"));
085: } catch (IntrospectionException ex) {
086: }
087:
088: try {
089: proplist
090: .add(new PropertyDescriptor("src",
091: ELJavascriptValidatorTag.class, null,
092: "setSrcExpr"));
093: } catch (IntrospectionException ex) {
094: }
095:
096: try {
097: proplist.add(new PropertyDescriptor("staticJavascript",
098: ELJavascriptValidatorTag.class, null,
099: "setStaticJavascriptExpr"));
100: } catch (IntrospectionException ex) {
101: }
102:
103: try {
104: proplist.add(new PropertyDescriptor("htmlComment",
105: ELJavascriptValidatorTag.class, null,
106: "setHtmlCommentExpr"));
107: } catch (IntrospectionException ex) {
108: }
109:
110: try {
111: proplist.add(new PropertyDescriptor("bundle",
112: ELJavascriptValidatorTag.class, null,
113: "setBundleExpr"));
114: } catch (IntrospectionException ex) {
115: }
116:
117: PropertyDescriptor[] result = new PropertyDescriptor[proplist
118: .size()];
119:
120: return ((PropertyDescriptor[]) proplist.toArray(result));
121: }
122: }
|