dmkarr 2002/10/15 20:48:26
Modified: contrib/struts-el/src/share/org/apache/strutsel/taglib/html
ELTextTag.java ELTextareaTag.java ELSubmitTag.java
ELSelectTag.java
Added: contrib/struts-el/src/share/org/apache/strutsel/taglib/html
ELTextTagBeanInfo.java ELTextareaTagBeanInfo.java
ELSubmitTagBeanInfo.java ELSelectTagBeanInfo.java
Log:
More boolean attribute mapping fixes
Revision Changes Path
1.4 +72 -11
jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELTextTag.java
Index: ELTextTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELTextTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ELTextTag.java 1 Oct 2002 04:25:50 -0000 1.3
+++ ELTextTag.java 16 Oct 2002 03:48:26 -0000 1.4
@@ -62,7 +62,7 @@
import org.apache.struts.taglib.html.TextTag;
import javax.servlet.jsp.JspException;
-import org.apache.taglibs.standard.tag.el.core.ExpressionUtil;
+import org.apache.strutsel.taglib.utils.EvalHelper;
import org.apache.taglibs.standard.tag.common.core.NullAttributeException;
/**
@@ -80,6 +80,64 @@
public class ELTextTag extends TextTag {
/**
+ * String value of the "disabled" attribute.
+ */
+ private String disabledExpr;
+ /**
+ * String value of the "indexed" attribute.
+ */
+ private String indexedExpr;
+ /**
+ * String value of the "readonly" attribute.
+ */
+ private String readonlyExpr;
+
+ /**
+ * Returns the string value of the "disabled" attribute.
+ */
+ public String getDisabledExpr() { return (disabledExpr); }
+ /**
+ * Returns the string value of the "indexed" attribute.
+ */
+ public String getIndexedExpr() { return (indexedExpr); }
+ /**
+ * Returns the string value of the "readonly" attribute.
+ */
+ public String getReadonlyExpr() { return (readonlyExpr); }
+
+ /**
+ * Sets the string value of the "disabled" attribute. This attribute is
+ * mapped to this method by the <code>ELTextTagBeanInfo</code> class.
+ */
+ public void setDisabledExpr(String disabledExpr)
+ { this.disabledExpr = disabledExpr; }
+
+ /**
+ * Sets the string value of the "indexed" attribute. This attribute is
+ * mapped to this method by the <code>ELTextTagBeanInfo</code> class.
+ */
+ public void setIndexedExpr(String indexedExpr)
+ { this.indexedExpr = indexedExpr; }
+
+ /**
+ * Sets the string value of the "readonly" attribute. This attribute is
+ * mapped to this method by the <code>ELTextTagBeanInfo</code> class.
+ */
+ public void setReadonlyExpr(String readonlyExpr)
+ { this.readonlyExpr = readonlyExpr; }
+
+ /**
+ * Resets attribute values for tag reuse.
+ */
+ public void release()
+ {
+ super.release();
+ setDisabledExpr(null);
+ setIndexedExpr(null);
+ setReadonlyExpr(null);
+ }
+
+ /**
* Process the start tag.
*
* @exception JspException if a JSP exception has occurred
@@ -91,7 +149,8 @@
/**
* Evaluates and returns a single attribute value, given the attribute
- * name, attribute value, and attribute type. It uses
+ * name, attribute value, and attribute type. It uses the
+ * <code>EvalHelper</code> class to interface to
* <code>ExpressionUtil.evalNotNull</code> to do the actual evaluation, and
* it passes to this the name of the current tag, the <code>this</code>
* pointer, and the current pageContext.
@@ -99,6 +158,8 @@
* @param attrName attribute name being evaluated
* @param attrValue String value of attribute to be evaluated using EL
* @param attrType Required resulting type of attribute value
+ * @exception NullAttributeException if either the <code>attrValue</code>
+ * was null, or the resulting evaluated value was null.
* @return Resulting attribute value
*/
private Object evalAttr(String attrName,
@@ -106,8 +167,8 @@
Class attrType)
throws JspException, NullAttributeException
{
- return (ExpressionUtil.evalNotNull("text", attrName, attrValue,
- attrType, this, pageContext));
+ return (EvalHelper.eval("text", attrName, attrValue, attrType,
+ this, pageContext));
}
/**
@@ -139,7 +200,7 @@
}
try {
- setDisabled(((Boolean) evalAttr("disabled", getDisabled() + "",
+ setDisabled(((Boolean) evalAttr("disabled", getDisabledExpr(),
Boolean.class)).
booleanValue());
} catch (NullAttributeException ex) {
@@ -147,7 +208,7 @@
}
try {
- setIndexed(((Boolean) evalAttr("indexed", getIndexed() + "",
+ setIndexed(((Boolean) evalAttr("indexed", getIndexedExpr(),
Boolean.class)).
booleanValue());
} catch (NullAttributeException ex) {
@@ -265,7 +326,7 @@
}
try {
- setReadonly(((Boolean) evalAttr("readonly", getReadonly()+"",
+ setReadonly(((Boolean) evalAttr("readonly", getReadonlyExpr(),
Boolean.class)).
booleanValue());
} catch (NullAttributeException ex) {
1.4 +72 -11
jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELTextareaTag.java
Index: ELTextareaTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELTextareaTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ELTextareaTag.java 1 Oct 2002 04:25:50 -0000 1.3
+++ ELTextareaTag.java 16 Oct 2002 03:48:26 -0000 1.4
@@ -62,7 +62,7 @@
import org.apache.struts.taglib.html.TextareaTag;
import javax.servlet.jsp.JspException;
-import org.apache.taglibs.standard.tag.el.core.ExpressionUtil;
+import org.apache.strutsel.taglib.utils.EvalHelper;
import org.apache.taglibs.standard.tag.common.core.NullAttributeException;
/**
@@ -81,6 +81,64 @@
public class ELTextareaTag extends TextareaTag {
/**
+ * String value of the "disabled" attribute.
+ */
+ private String disabledExpr;
+ /**
+ * String value of the "indexed" attribute.
+ */
+ private String indexedExpr;
+ /**
+ * String value of the "readonly" attribute.
+ */
+ private String readonlyExpr;
+
+ /**
+ * Returns the string value of the "disabled" attribute.
+ */
+ public String getDisabledExpr() { return (disabledExpr); }
+ /**
+ * Returns the string value of the "indexed" attribute.
+ */
+ public String getIndexedExpr() { return (indexedExpr); }
+ /**
+ * Returns the string value of the "readonly" attribute.
+ */
+ public String getReadonlyExpr() { return (readonlyExpr); }
+
+ /**
+ * Sets the string value of the "disabled" attribute. This attribute is
+ * mapped to this method by the <code>ELTextareaTagBeanInfo</code> class.
+ */
+ public void setDisabledExpr(String disabledExpr)
+ { this.disabledExpr = disabledExpr; }
+
+ /**
+ * Sets the string value of the "indexed" attribute. This attribute is
+ * mapped to this method by the <code>ELTextareaTagBeanInfo</code> class.
+ */
+ public void setIndexedExpr(String indexedExpr)
+ { this.indexedExpr = indexedExpr; }
+
+ /**
+ * Sets the string value of the "readonly" attribute. This attribute is
+ * mapped to this method by the <code>ELTextareaTagBeanInfo</code> class.
+ */
+ public void setReadonlyExpr(String readonlyExpr)
+ { this.readonlyExpr = readonlyExpr; }
+
+ /**
+ * Resets attribute values for tag reuse.
+ */
+ public void release()
+ {
+ super.release();
+ setDisabledExpr(null);
+ setIndexedExpr(null);
+ setReadonlyExpr(null);
+ }
+
+ /**
* Process the start tag.
*
* @exception JspException if a JSP exception has occurred
@@ -92,7 +150,8 @@
/**
* Evaluates and returns a single attribute value, given the attribute
- * name, attribute value, and attribute type. It uses
+ * name, attribute value, and attribute type. It uses the
+ * <code>EvalHelper</code> class to interface to
* <code>ExpressionUtil.evalNotNull</code> to do the actual evaluation, and
* it passes to this the name of the current tag, the <code>this</code>
* pointer, and the current pageContext.
@@ -100,6 +159,8 @@
* @param attrName attribute name being evaluated
* @param attrValue String value of attribute to be evaluated using EL
* @param attrType Required resulting type of attribute value
+ * @exception NullAttributeException if either the <code>attrValue</code>
+ * was null, or the resulting evaluated value was null.
* @return Resulting attribute value
*/
private Object evalAttr(String attrName,
@@ -107,8 +168,8 @@
Class attrType)
throws JspException, NullAttributeException
{
- return (ExpressionUtil.evalNotNull("textarea", attrName, attrValue,
- attrType, this, pageContext));
+ return (EvalHelper.eval("textarea", attrName, attrValue, attrType,
+ this, pageContext));
}
/**
@@ -146,7 +207,7 @@
}
try {
- setDisabled(((Boolean) evalAttr("disabled", getDisabled() + "",
+ setDisabled(((Boolean) evalAttr("disabled", getDisabledExpr(),
Boolean.class)).
booleanValue());
} catch (NullAttributeException ex) {
@@ -154,7 +215,7 @@
}
try {
- setIndexed(((Boolean) evalAttr("indexed", getIndexed() + "",
+ setIndexed(((Boolean) evalAttr("indexed", getIndexedExpr(),
Boolean.class)).
booleanValue());
} catch (NullAttributeException ex) {
@@ -265,7 +326,7 @@
}
try {
- setReadonly(((Boolean) evalAttr("readonly", getReadonly()+"",
+ setReadonly(((Boolean) evalAttr("readonly", getReadonlyExpr(),
Boolean.class)).
booleanValue());
} catch (NullAttributeException ex) {
1.4 +55 -10
jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELSubmitTag.java
Index: ELSubmitTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELSubmitTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ELSubmitTag.java 1 Oct 2002 04:25:50 -0000 1.3
+++ ELSubmitTag.java 16 Oct 2002 03:48:26 -0000 1.4
@@ -62,7 +62,7 @@
import org.apache.struts.taglib.html.SubmitTag;
import javax.servlet.jsp.JspException;
-import org.apache.taglibs.standard.tag.el.core.ExpressionUtil;
+import org.apache.strutsel.taglib.utils.EvalHelper;
import org.apache.taglibs.standard.tag.common.core.NullAttributeException;
/**
@@ -80,6 +80,48 @@
public class ELSubmitTag extends SubmitTag {
/**
+ * String value of the "disabled" attribute.
+ */
+ private String disabledExpr;
+ /**
+ * String value of the "indexed" attribute.
+ */
+ private String indexedExpr;
+
+ /**
+ * Returns the string value of the "disabled" attribute.
+ */
+ public String getDisabledExpr() { return (disabledExpr); }
+ /**
+ * Returns the string value of the "indexed" attribute.
+ */
+ public String getIndexedExpr() { return (indexedExpr); }
+
+ /**
+ * Sets the string value of the "disabled" attribute. This attribute is
+ * mapped to this method by the <code>ELSubmitTagBeanInfo</code> class.
+ */
+ public void setDisabledExpr(String disabledExpr)
+ { this.disabledExpr = disabledExpr; }
+
+ /**
+ * Sets the string value of the "indexed" attribute. This attribute is
+ * mapped to this method by the <code>ELSubmitTagBeanInfo</code> class.
+ */
+ public void setIndexedExpr(String indexedExpr)
+ { this.indexedExpr = indexedExpr; }
+
+ /**
+ * Resets attribute values for tag reuse.
+ */
+ public void release()
+ {
+ super.release();
+ setDisabledExpr(null);
+ setIndexedExpr(null);
+ }
+
+ /**
* Process the start tag.
*
* @exception JspException if a JSP exception has occurred
@@ -91,7 +133,8 @@
/**
* Evaluates and returns a single attribute value, given the attribute
- * name, attribute value, and attribute type. It uses
+ * name, attribute value, and attribute type. It uses the
+ * <code>EvalHelper</code> class to interface to
* <code>ExpressionUtil.evalNotNull</code> to do the actual evaluation, and
* it passes to this the name of the current tag, the <code>this</code>
* pointer, and the current pageContext.
@@ -99,6 +142,8 @@
* @param attrName attribute name being evaluated
* @param attrValue String value of attribute to be evaluated using EL
* @param attrType Required resulting type of attribute value
+ * @exception NullAttributeException if either the <code>attrValue</code>
+ * was null, or the resulting evaluated value was null.
* @return Resulting attribute value
*/
private Object evalAttr(String attrName,
@@ -106,8 +151,8 @@
Class attrType)
throws JspException, NullAttributeException
{
- return (ExpressionUtil.evalNotNull("submit", attrName, attrValue,
- attrType, this, pageContext));
+ return (EvalHelper.eval("submit", attrName, attrValue, attrType,
+ this, pageContext));
}
/**
@@ -139,7 +184,7 @@
}
try {
- setDisabled(((Boolean) evalAttr("disabled", getDisabled() + "",
+ setDisabled(((Boolean) evalAttr("disabled", getDisabledExpr(),
Boolean.class)).
booleanValue());
} catch (NullAttributeException ex) {
@@ -147,7 +192,7 @@
}
try {
- setIndexed(((Boolean) evalAttr("indexed", getIndexed() + "",
+ setIndexed(((Boolean) evalAttr("indexed", getIndexedExpr(),
Boolean.class)).
booleanValue());
} catch (NullAttributeException ex) {
1.4 +55 -10
jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELSelectTag.java
Index: ELSelectTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELSelectTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ELSelectTag.java 1 Oct 2002 04:25:50 -0000 1.3
+++ ELSelectTag.java 16 Oct 2002 03:48:26 -0000 1.4
@@ -62,7 +62,7 @@
import org.apache.struts.taglib.html.SelectTag;
import javax.servlet.jsp.JspException;
-import org.apache.taglibs.standard.tag.el.core.ExpressionUtil;
+import org.apache.strutsel.taglib.utils.EvalHelper;
import org.apache.taglibs.standard.tag.common.core.NullAttributeException;
/**
@@ -82,6 +82,48 @@
public class ELSelectTag extends SelectTag {
/**
+ * String value of the "disabled" attribute.
+ */
+ private String disabledExpr;
+ /**
+ * String value of the "indexed" attribute.
+ */
+ private String indexedExpr;
+
+ /**
+ * Returns the string value of the "disabled" attribute.
+ */
+ public String getDisabledExpr() { return (disabledExpr); }
+ /**
+ * Returns the string value of the "indexed" attribute.
+ */
+ public String getIndexedExpr() { return (indexedExpr); }
+
+ /**
+ * Sets the string value of the "disabled" attribute. This attribute is
+ * mapped to this method by the <code>ELSelectTagBeanInfo</code> class.
+ */
+ public void setDisabledExpr(String disabledExpr)
+ { this.disabledExpr = disabledExpr; }
+
+ /**
+ * Sets the string value of the "indexed" attribute. This attribute is
+ * mapped to this method by the <code>ELSelectTagBeanInfo</code> class.
+ */
+ public void setIndexedExpr(String indexedExpr)
+ { this.indexedExpr = indexedExpr; }
+
+ /**
+ * Resets attribute values for tag reuse.
+ */
+ public void release()
+ {
+ super.release();
+ setDisabledExpr(null);
+ setIndexedExpr(null);
+ }
+
+ /**
* Process the start tag.
*
* @exception JspException if a JSP exception has occurred
@@ -93,7 +135,8 @@
/**
* Evaluates and returns a single attribute value, given the attribute
- * name, attribute value, and attribute type. It uses
+ * name, attribute value, and attribute type. It uses the
+ * <code>EvalHelper</code> class to interface to
* <code>ExpressionUtil.evalNotNull</code> to do the actual evaluation, and
* it passes to this the name of the current tag, the <code>this</code>
* pointer, and the current pageContext.
@@ -101,6 +144,8 @@
* @param attrName attribute name being evaluated
* @param attrValue String value of attribute to be evaluated using EL
* @param attrType Required resulting type of attribute value
+ * @exception NullAttributeException if either the <code>attrValue</code>
+ * was null, or the resulting evaluated value was null.
* @return Resulting attribute value
*/
private Object evalAttr(String attrName,
@@ -108,8 +153,8 @@
Class attrType)
throws JspException, NullAttributeException
{
- return (ExpressionUtil.evalNotNull("select", attrName, attrValue,
- attrType, this, pageContext));
+ return (EvalHelper.eval("select", attrName, attrValue, attrType,
+ this, pageContext));
}
/**
@@ -141,7 +186,7 @@
}
try {
- setDisabled(((Boolean) evalAttr("disabled", getDisabled() + "",
+ setDisabled(((Boolean) evalAttr("disabled", getDisabledExpr(),
Boolean.class)).
booleanValue());
} catch (NullAttributeException ex) {
@@ -149,7 +194,7 @@
}
try {
- setIndexed(((Boolean) evalAttr("indexed", getIndexed() + "",
+ setIndexed(((Boolean) evalAttr("indexed", getIndexedExpr(),
Boolean.class)).
booleanValue());
} catch (NullAttributeException ex) {
1.1
jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELTextTagBeanInfo.java
Index: ELTextTagBeanInfo.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELTextTagBeanInfo.java,v
1.1 2002/10/16 03:48:26 dmkarr Exp $
* $Revision: 1.1 $
* $Date: 2002/10/16 03:48:26 $
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowledgement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Struts", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.strutsel.taglib.html;
import java.beans.PropertyDescriptor;
import java.beans.IntrospectionException;
import java.beans.SimpleBeanInfo;
/**
* This is the <code>BeanInfo</code> descriptor for the
* <code>org.apache.strutsel.taglib.html.ELTextTag</code> class. It is
* needed to override the default mapping of custom tag attribute names to
* class attribute names.
*<p>
* This is necessary because the base class,
* <code>org.apache.struts.taglib.html.TextTag</code> defines some
* attributes whose type is not <code>java.lang.String</code>, so the subclass
* needs to define setter methods of a different name, which this class maps
* to.
*<p>
* Unfortunately, if a <code>BeanInfo</code> class needs to be provided to
* change the mapping of one attribute, it has to specify the mappings of ALL
* attributes, even if all the others use the expected mappings of "name" to
* "method".
*/
public class ELTextTagBeanInfo extends SimpleBeanInfo
{
public PropertyDescriptor[] getPropertyDescriptors()
{
PropertyDescriptor[] result = new PropertyDescriptor[30];
try {
result[0] = new PropertyDescriptor("accesskey", ELTextTag.class,
null, "setAccesskey");
result[1] = new PropertyDescriptor("alt", ELTextTag.class,
null, "setAlt");
result[2] = new PropertyDescriptor("altKey", ELTextTag.class,
null, "setAltKey");
// This attribute has a non-standard mapping.
result[3] = new PropertyDescriptor("disabled", ELTextTag.class,
null, "setDisabledExpr");
// This attribute has a non-standard mapping.
result[4] = new PropertyDescriptor("indexed", ELTextTag.class,
null, "setIndexedExpr");
result[5] = new PropertyDescriptor("maxlength", ELTextTag.class,
null, "setMaxlength");
result[6] = new PropertyDescriptor("name", ELTextTag.class,
null, "setName");
result[7] = new PropertyDescriptor("onblur", ELTextTag.class,
null, "setOnblur");
result[8] = new PropertyDescriptor("onchange", ELTextTag.class,
null, "setOnchange");
result[9] = new PropertyDescriptor("onclick", ELTextTag.class,
null, "setOnclick");
result[10] = new PropertyDescriptor("ondblclick",
ELTextTag.class,
null, "setOndblclick");
result[11] = new PropertyDescriptor("onfocus", ELTextTag.class,
null, "setOnfocus");
result[12] = new PropertyDescriptor("onkeydown",
ELTextTag.class,
null, "setOnkeydown");
result[13] = new PropertyDescriptor("onkeypress",
ELTextTag.class,
null, "setOnkeypress");
result[14] = new PropertyDescriptor("onkeyup", ELTextTag.class,
null, "setOnkeyup");
result[15] = new PropertyDescriptor("onmousedown",
ELTextTag.class,
null, "setOnmousedown");
result[16] = new PropertyDescriptor("onmousemove",
ELTextTag.class,
null, "setOnmousemove");
result[17] = new PropertyDescriptor("onmouseout",
ELTextTag.class,
null, "setOnmouseout");
result[18] = new PropertyDescriptor("onmouseover",
ELTextTag.class,
null, "setOnmouseover");
result[19] = new PropertyDescriptor("onmouseup",
ELTextTag.class,
null, "setOnmouseup");
result[20] = new PropertyDescriptor("property", ELTextTag.class,
null, "setProperty");
result[21] = new PropertyDescriptor("readonly", ELTextTag.class,
null, "setReadonlyExpr");
result[22] = new PropertyDescriptor("size", ELTextTag.class,
null, "setSize");
result[23] = new PropertyDescriptor("style", ELTextTag.class,
null, "setStyle");
result[24] = new PropertyDescriptor("styleClass",
ELTextTag.class,
null, "setStyleClass");
result[25] = new PropertyDescriptor("styleId", ELTextTag.class,
null, "setStyleId");
result[26] = new PropertyDescriptor("tabindex", ELTextTag.class,
null, "setTabindex");
result[27] = new PropertyDescriptor("title", ELTextTag.class,
null, "setTitle");
result[28] = new PropertyDescriptor("titleKey", ELTextTag.class,
null, "setTitleKey");
result[29] = new PropertyDescriptor("value", ELTextTag.class,
null, "setValue");
}
catch (IntrospectionException ex) {
ex.printStackTrace();
}
return (result);
}
}
1.1
jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELTextareaTagBeanInfo.java
Index: ELTextareaTagBeanInfo.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELTextareaTagBeanInfo.java,v
1.1 2002/10/16 03:48:26 dmkarr Exp $
* $Revision: 1.1 $
* $Date: 2002/10/16 03:48:26 $
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowledgement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Struts", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.strutsel.taglib.html;
import java.beans.PropertyDescriptor;
import java.beans.IntrospectionException;
import java.beans.SimpleBeanInfo;
/**
* This is the <code>BeanInfo</code> descriptor for the
* <code>org.apache.strutsel.taglib.html.ELTextareaTag</code> class. It is
* needed to override the default mapping of custom tag attribute names to
* class attribute names.
*<p>
* This is necessary because the base class,
* <code>org.apache.struts.taglib.html.TextareaTag</code> defines some
* attributes whose type is not <code>java.lang.String</code>, so the subclass
* needs to define setter methods of a different name, which this class maps
* to.
*<p>
* Unfortunately, if a <code>BeanInfo</code> class needs to be provided to
* change the mapping of one attribute, it has to specify the mappings of ALL
* attributes, even if all the others use the expected mappings of "name" to
* "method".
*/
public class ELTextareaTagBeanInfo extends SimpleBeanInfo
{
public PropertyDescriptor[] getPropertyDescriptors()
{
PropertyDescriptor[] result = new PropertyDescriptor[30];
try {
result[0] = new PropertyDescriptor("accesskey", ELTextareaTag.class,
null, "setAccesskey");
result[1] = new PropertyDescriptor("alt", ELTextareaTag.class,
null, "setAlt");
result[2] = new PropertyDescriptor("altKey", ELTextareaTag.class,
null, "setAltKey");
result[3] = new PropertyDescriptor("cols", ELTextareaTag.class,
null, "setCols");
// This attribute has a non-standard mapping.
result[4] = new PropertyDescriptor("disabled", ELTextareaTag.class,
null, "setDisabledExpr");
// This attribute has a non-standard mapping.
result[5] = new PropertyDescriptor("indexed", ELTextareaTag.class,
null, "setIndexedExpr");
result[6] = new PropertyDescriptor("name", ELTextareaTag.class,
null, "setName");
result[7] = new PropertyDescriptor("onblur", ELTextareaTag.class,
null, "setOnblur");
result[8] = new PropertyDescriptor("onchange", ELTextareaTag.class,
null, "setOnchange");
result[9] = new PropertyDescriptor("onclick", ELTextareaTag.class,
null, "setOnclick");
result[10] = new PropertyDescriptor("ondblclick",
ELTextareaTag.class,
null, "setOndblclick");
result[11] = new PropertyDescriptor("onfocus", ELTextareaTag.class,
null, "setOnfocus");
result[12] = new PropertyDescriptor("onkeydown",
ELTextareaTag.class,
null, "setOnkeydown");
result[13] = new PropertyDescriptor("onkeypress",
ELTextareaTag.class,
null, "setOnkeypress");
result[14] = new PropertyDescriptor("onkeyup", ELTextareaTag.class,
null, "setOnkeyup");
result[15] = new PropertyDescriptor("onmousedown",
ELTextareaTag.class,
null, "setOnmousedown");
result[16] = new PropertyDescriptor("onmousemove",
ELTextareaTag.class,
null, "setOnmousemove");
result[17] = new PropertyDescriptor("onmouseout",
ELTextareaTag.class,
null, "setOnmouseout");
result[18] = new PropertyDescriptor("onmouseover",
ELTextareaTag.class,
null, "setOnmouseover");
result[19] = new PropertyDescriptor("onmouseup",
ELTextareaTag.class,
null, "setOnmouseup");
result[20] = new PropertyDescriptor("property", ELTextareaTag.class,
null, "setProperty");
result[21] = new PropertyDescriptor("readonly", ELTextareaTag.class,
null, "setReadonlyExpr");
result[22] = new PropertyDescriptor("rows", ELTextareaTag.class,
null, "setRows");
result[23] = new PropertyDescriptor("style", ELTextareaTag.class,
null, "setStyle");
result[24] = new PropertyDescriptor("styleClass",
ELTextareaTag.class,
null, "setStyleClass");
result[25] = new PropertyDescriptor("styleId", ELTextareaTag.class,
null, "setStyleId");
result[26] = new PropertyDescriptor("tabindex", ELTextareaTag.class,
null, "setTabindex");
result[27] = new PropertyDescriptor("title", ELTextareaTag.class,
null, "setTitle");
result[28] = new PropertyDescriptor("titleKey", ELTextareaTag.class,
null, "setTitleKey");
result[29] = new PropertyDescriptor("value", ELTextareaTag.class,
null, "setValue");
}
catch (IntrospectionException ex) {
ex.printStackTrace();
}
return (result);
}
}
1.1
jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELSubmitTagBeanInfo.java
Index: ELSubmitTagBeanInfo.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELSubmitTagBeanInfo.java,v
1.1 2002/10/16 03:48:26 dmkarr Exp $
* $Revision: 1.1 $
* $Date: 2002/10/16 03:48:26 $
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowledgement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Struts", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.strutsel.taglib.html;
import java.beans.PropertyDescriptor;
import java.beans.IntrospectionException;
import java.beans.SimpleBeanInfo;
/**
* This is the <code>BeanInfo</code> descriptor for the
* <code>org.apache.strutsel.taglib.html.ELSubmitTag</code> class. It is needed
* to override the default mapping of custom tag attribute names to class
* attribute names.
*<p>
* This is necessary because the base class,
* <code>org.apache.struts.taglib.html.SubmitTag</code> defines some
* attributes whose type is not <code>java.lang.String</code>, so the subclass
* needs to define setter methods of a different name, which this class maps
* to.
*<p>
* Unfortunately, if a <code>BeanInfo</code> class needs to be provided to
* change the mapping of one attribute, it has to specify the mappings of ALL
* attributes, even if all the others use the expected mappings of "name" to
* "method".
*/
public class ELSubmitTagBeanInfo extends SimpleBeanInfo
{
public PropertyDescriptor[] getPropertyDescriptors()
{
PropertyDescriptor[] result = new PropertyDescriptor[26];
try {
result[0] = new PropertyDescriptor("accesskey", ELSubmitTag.class,
null, "setAccesskey");
result[1] = new PropertyDescriptor("alt", ELSubmitTag.class,
null, "setAlt");
result[2] = new PropertyDescriptor("altKey", ELSubmitTag.class,
null, "setAltKey");
// This attribute has a non-standard mapping.
result[3] = new PropertyDescriptor("disabled", ELSubmitTag.class,
null, "setDisabledExpr");
// This attribute has a non-standard mapping.
result[4] = new PropertyDescriptor("indexed", ELSubmitTag.class,
null, "setIndexedExpr");
result[5] = new PropertyDescriptor("onblur", ELSubmitTag.class,
null, "setOnblur");
result[6] = new PropertyDescriptor("onchange", ELSubmitTag.class,
null, "setOnchange");
result[7] = new PropertyDescriptor("onclick", ELSubmitTag.class,
null, "setOnclick");
result[8] = new PropertyDescriptor("ondblclick", ELSubmitTag.class,
null, "setOndblclick");
result[9] = new PropertyDescriptor("onfocus", ELSubmitTag.class,
null, "setOnfocus");
result[10] = new PropertyDescriptor("onkeydown", ELSubmitTag.class,
null, "setOnkeydown");
result[11] = new PropertyDescriptor("onkeypress", ELSubmitTag.class,
null, "setOnkeypress");
result[12] = new PropertyDescriptor("onkeyup", ELSubmitTag.class,
null, "setOnkeyup");
result[13] = new PropertyDescriptor("onmousedown",
ELSubmitTag.class,
null, "setOnmousedown");
result[14] = new PropertyDescriptor("onmousemove",
ELSubmitTag.class,
null, "setOnmousemove");
result[15] = new PropertyDescriptor("onmouseout", ELSubmitTag.class,
null, "setOnmouseout");
result[16] = new PropertyDescriptor("onmouseover",
ELSubmitTag.class,
null, "setOnmouseover");
result[17] = new PropertyDescriptor("onmouseup", ELSubmitTag.class,
null, "setOnmouseup");
result[18] = new PropertyDescriptor("property", ELSubmitTag.class,
null, "setProperty");
result[19] = new PropertyDescriptor("style", ELSubmitTag.class,
null, "setStyle");
result[20] = new PropertyDescriptor("styleClass", ELSubmitTag.class,
null, "setStyleClass");
result[21] = new PropertyDescriptor("styleId", ELSubmitTag.class,
null, "setStyleId");
result[22] = new PropertyDescriptor("tabindex", ELSubmitTag.class,
null, "setTabindex");
result[23] = new PropertyDescriptor("title", ELSubmitTag.class,
null, "setTitle");
result[24] = new PropertyDescriptor("titleKey", ELSubmitTag.class,
null, "setTitleKey");
result[25] = new PropertyDescriptor("value", ELSubmitTag.class,
null, "setValue");
}
catch (IntrospectionException ex) {
ex.printStackTrace();
}
return (result);
}
}
1.1
jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELSelectTagBeanInfo.java
Index: ELSelectTagBeanInfo.java
===================================================================
/*
* $Header:
/home/cvs/jakarta-struts/contrib/struts-el/src/share/org/apache/strutsel/taglib/html/ELSelectTagBeanInfo.java,v
1.1 2002/10/16 03:48:26 dmkarr Exp $
* $Revision: 1.1 $
* $Date: 2002/10/16 03:48:26 $
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowledgement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Struts", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.strutsel.taglib.html;
import java.beans.PropertyDescriptor;
import java.beans.IntrospectionException;
import java.beans.SimpleBeanInfo;
/**
* This is the <code>BeanInfo</code> descriptor for the
* <code>org.apache.strutsel.taglib.html.ELSelectTag</code> class. It is needed
* to override the default mapping of custom tag attribute names to class
* attribute names.
*<p>
* This is necessary because the base class,
* <code>org.apache.struts.taglib.html.SelectTag</code> defines some
* attributes whose type is not <code>java.lang.String</code>, so the subclass
* needs to define setter methods of a different name, which this class maps
* to.
*<p>
* Unfortunately, if a <code>BeanInfo</code> class needs to be provided to
* change the mapping of one attribute, it has to specify the mappings of ALL
* attributes, even if all the others use the expected mappings of "name" to
* "method".
*/
public class ELSelectTagBeanInfo extends SimpleBeanInfo
{
public PropertyDescriptor[] getPropertyDescriptors()
{
PropertyDescriptor[] result = new PropertyDescriptor[29];
try {
result[0] = new PropertyDescriptor("accesskey", ELSelectTag.class,
null, "setAccesskey");
result[1] = new PropertyDescriptor("alt", ELSelectTag.class,
null, "setAlt");
result[2] = new PropertyDescriptor("altKey", ELSelectTag.class,
null, "setAltKey");
// This attribute has a non-standard mapping.
result[3] = new PropertyDescriptor("disabled", ELSelectTag.class,
null, "setDisabledExpr");
// This attribute has a non-standard mapping.
result[4] = new PropertyDescriptor("indexed", ELSelectTag.class,
null, "setIndexedExpr");
result[5] = new PropertyDescriptor("multiple", ELSelectTag.class,
null, "setMultiple");
result[6] = new PropertyDescriptor("name", ELSelectTag.class,
null, "setName");
result[7] = new PropertyDescriptor("onblur", ELSelectTag.class,
null, "setOnblur");
result[8] = new PropertyDescriptor("onchange", ELSelectTag.class,
null, "setOnchange");
result[9] = new PropertyDescriptor("onclick", ELSelectTag.class,
null, "setOnclick");
result[10] = new PropertyDescriptor("ondblclick", ELSelectTag.class,
null, "setOndblclick");
result[11] = new PropertyDescriptor("onfocus", ELSelectTag.class,
null, "setOnfocus");
result[12] = new PropertyDescriptor("onkeydown", ELSelectTag.class,
null, "setOnkeydown");
result[13] = new PropertyDescriptor("onkeypress", ELSelectTag.class,
null, "setOnkeypress");
result[14] = new PropertyDescriptor("onkeyup", ELSelectTag.class,
null, "setOnkeyup");
result[15] = new PropertyDescriptor("onmousedown",
ELSelectTag.class,
null, "setOnmousedown");
result[16] = new PropertyDescriptor("onmousemove",
ELSelectTag.class,
null, "setOnmousemove");
result[17] = new PropertyDescriptor("onmouseout", ELSelectTag.class,
null, "setOnmouseout");
result[18] = new PropertyDescriptor("onmouseover",
ELSelectTag.class,
null, "setOnmouseover");
result[19] = new PropertyDescriptor("onmouseup", ELSelectTag.class,
null, "setOnmouseup");
result[20] = new PropertyDescriptor("property", ELSelectTag.class,
null, "setProperty");
result[21] = new PropertyDescriptor("size", ELSelectTag.class,
null, "setSize");
result[22] = new PropertyDescriptor("style", ELSelectTag.class,
null, "setStyle");
result[23] = new PropertyDescriptor("styleClass",
ELSelectTag.class,
null, "setStyleClass");
result[24] = new PropertyDescriptor("styleId", ELSelectTag.class,
null, "setStyleId");
result[25] = new PropertyDescriptor("tabindex", ELSelectTag.class,
null, "setTabindex");
result[26] = new PropertyDescriptor("title", ELSelectTag.class,
null, "setTitle");
result[27] = new PropertyDescriptor("titleKey", ELSelectTag.class,
null, "setTitleKey");
result[28] = new PropertyDescriptor("value", ELSelectTag.class,
null, "setValue");
}
catch (IntrospectionException ex) {
ex.printStackTrace();
}
return (result);
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>