org.chwf.taglib.jhtml
Class InputTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--org.chwf.taglib.base.LifeCycleTagSupport
              |
              +--org.chwf.taglib.base.ObjectTagSupport
                    |
                    +--org.chwf.taglib.jhtml.FieldTagSupport
                          |
                          +--org.chwf.taglib.jhtml.InputTag
All Implemented Interfaces:
Parameterized, java.io.Serializable, javax.servlet.jsp.tagext.Tag, ValidationData
Direct Known Subclasses:
FieldTag

public class InputTag
extends FieldTagSupport
implements ValidationData

Tag handler for the <input> tag.

Author:
Paul Strack
See Also:
Serialized Form

Field Summary
static java.lang.String TRUE_STRING
          Constant for true string values.
 
Fields inherited from class org.chwf.taglib.base.ObjectTagSupport
DEFAULT_OBJECT
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface org.chwf.plugin.ValidationData
TYPE_CHECKBOX, TYPE_FIXED, TYPE_HIDDEN, TYPE_PASSWORD, TYPE_SELECT, TYPE_TEXT, TYPE_TEXTAREA
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
InputTag()
           
 
Method Summary
 void cleanup()
          Clean up data for tag handler reuse and pooling.
 int doStart()
          Print the input element.
 java.util.Map getOptionsMap()
          The option map for select lists.
 java.lang.String getType()
          Gets the input element type.
 java.lang.Boolean getValidations()
          Whether validations are supported.
 void init()
          Initialization.
 void setAccept(java.lang.String value)
          Pass-through attribute.
 void setAccesskey(java.lang.String value)
          Pass-through attribute.
 void setCols(java.lang.String value)
          Pass-through attribute.
 void setDisabled(java.lang.String value)
          Pass-through attribute.
 void setId(java.lang.String value)
          Pass-through attribute.
 void setLang(java.lang.String value)
          Pass-through attribute.
 void setMaxlength(java.lang.String value)
          Pass-through attribute.
 void setName(java.lang.String name)
          Calls superclass method.
 void setObject(java.lang.String objectName)
          Calls superclass method.
 void setOptions(java.lang.String options)
          The name of the web application variable containing input items options.
 void setProperty(java.lang.String property)
          Calls superclass method.
 void setRows(java.lang.String value)
          Pass-through attribute.
 void setSize(java.lang.String value)
          Pass-through attribute.
 void setStyle(java.lang.String value)
          Pass-through attribute.
 void setStyleClass(java.lang.String value)
          Pass-through attribute.
 void setTitle(java.lang.String value)
          Pass-through attribute.
 void setType(java.lang.String type)
          Set the input element type.
 void setValidations(java.lang.Boolean validations)
          Whether validations are supported.
 void setWrap(java.lang.String value)
          Pass-through attribute.
 
Methods inherited from class org.chwf.taglib.jhtml.FieldTagSupport
deriveLabel, getBeanFilter, getFieldValue, getFormTag, getLocalizedAttribute, getName, getPropertyAttribute
 
Methods inherited from class org.chwf.taglib.base.ObjectTagSupport
findObject, getEl, getObject, getProperty, getTagResult, getTagResult, getVar, setEl, setVar, storeDefaultObject
 
Methods inherited from class org.chwf.taglib.base.LifeCycleTagSupport
addAttribute, addParameter, doEnd, doEndTag, doStartTag, getAttribute, getAttributeNames, getParameter, getParameterNames, printAttributes
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.chwf.plugin.ValidationData
getLocalizedAttribute, getName, getPropertyAttribute
 

Field Detail

TRUE_STRING

public static final java.lang.String TRUE_STRING
Constant for true string values.
Constructor Detail

InputTag

public InputTag()
Method Detail

cleanup

public void cleanup()
Clean up data for tag handler reuse and pooling. Should be overridden in tag handler. Subclasses should always invoke their superclass's cleanup method: super.cleanup()
Overrides:
cleanup in class FieldTagSupport

setObject

public void setObject(java.lang.String objectName)
               throws javax.servlet.jsp.JspException
Calls superclass method. Is present here because of a bug in some servlet engines that requires tag attibute setters to be defined in the tag class itself.
Overrides:
setObject in class ObjectTagSupport
Parameters:
objectName - The object name.
Throws:
javax.servlet.jsp.JspException - For errors.

setProperty

public void setProperty(java.lang.String property)
                 throws javax.servlet.jsp.JspException
Calls superclass method. Is present here because of a bug in some servlet engines that requires tag attibute setters to be defined in the tag class itself.
Overrides:
setProperty in class ObjectTagSupport
Parameters:
property - The property name.
Throws:
javax.servlet.jsp.JspException - For errors.

setName

public void setName(java.lang.String name)
Calls superclass method. Is present here because of a bug in some servlet engines that requires tag attibute setters to be defined in the tag class itself.
Overrides:
setName in class FieldTagSupport
Parameters:
name - The field name.

setType

public void setType(java.lang.String type)
             throws javax.servlet.jsp.JspException
Set the input element type. Optional. The type value is converted to lowercase for consistency with the XHTML standard.
Parameters:
type - The input type.
Throws:
javax.servlet.jsp.JspException - If the type is not one of the known input element types, defined as TYPE_XXX constants.

getType

public java.lang.String getType()
                         throws javax.servlet.jsp.JspException
Gets the input element type. If no type is defined, it attempts to deduce the type for form object metadata.
Specified by:
getType in interface ValidationData
Returns:
The input type.
Throws:
javax.servlet.jsp.JspException - If the property cannot be initialized

setValidations

public void setValidations(java.lang.Boolean validations)
Whether validations are supported. If not specified, defaults to value in nesting formtag.
Parameters:
validations - Whether validations are supported.

getValidations

public java.lang.Boolean getValidations()
Whether validations are supported. May be null.
Returns:
Whether validations are supported.

setOptions

public void setOptions(java.lang.String options)
The name of the web application variable containing input items options.
Parameters:
options - The variable name for options.

getOptionsMap

public java.util.Map getOptionsMap()
                            throws javax.servlet.jsp.JspException
The option map for select lists. Uses the options map specified by the options attribute or the bean filters OPTIONS attribute.
Returns:
The option map.
Throws:
javax.servlet.jsp.JspException - If the option map cannot be found.

setStyleClass

public void setStyleClass(java.lang.String value)
Pass-through attribute. Same meaning as "class" in HTML.
Parameters:
value - The attribute value.

setId

public void setId(java.lang.String value)
Pass-through attribute. Same meaning as in HTML.
Overrides:
setId in class javax.servlet.jsp.tagext.TagSupport
Parameters:
value - The attribute value.

setLang

public void setLang(java.lang.String value)
Pass-through attribute. Same meaning as in HTML.
Parameters:
value - The attribute value.

setStyle

public void setStyle(java.lang.String value)
Pass-through attribute. Same meaning as in HTML.
Parameters:
value - The attribute value.

setTitle

public void setTitle(java.lang.String value)
Pass-through attribute. Same meaning as in HTML.
Parameters:
value - The attribute value.

setAccept

public void setAccept(java.lang.String value)
Pass-through attribute. Same meaning as in HTML.
Parameters:
value - The attribute value.

setAccesskey

public void setAccesskey(java.lang.String value)
Pass-through attribute. Same meaning as in HTML.
Parameters:
value - The attribute value.

setDisabled

public void setDisabled(java.lang.String value)
Pass-through attribute. Same meaning as in HTML.
Parameters:
value - The attribute value.

setMaxlength

public void setMaxlength(java.lang.String value)
Pass-through attribute. Same meaning as in HTML.
Parameters:
value - The attribute value.

setSize

public void setSize(java.lang.String value)
Pass-through attribute. Same meaning as in HTML.
Parameters:
value - The attribute value.

setCols

public void setCols(java.lang.String value)
Pass-through attribute. Same meaning as in HTML.
Parameters:
value - The attribute value.

setRows

public void setRows(java.lang.String value)
Pass-through attribute. Same meaning as in HTML.
Parameters:
value - The attribute value.

setWrap

public void setWrap(java.lang.String value)
Pass-through attribute. Same meaning as in HTML.
Parameters:
value - The attribute value.

init

public void init()
          throws javax.servlet.jsp.JspException
Initialization. Makes "cols" attribute default to value of "size".
Overrides:
init in class LifeCycleTagSupport
Throws:
javax.servlet.jsp.JspException - For errors.

doStart

public int doStart()
            throws java.io.IOException,
                   javax.servlet.jsp.JspException
Print the input element.
Overrides:
doStart in class LifeCycleTagSupport
Returns:
SKIP_BODY
Throws:
javax.servlet.jsp.JspException - If the property cannot be initialized.
java.io.IOException - For IO exceptions.


Copyright © 2002-2004, Paul Strack. All Rights Reserved.