public abstract class InputTagSupport extends HtmlTagSupport implements javax.servlet.jsp.tagext.TryCatchFinally
Modifier and Type | Field and Description |
---|---|
protected TagErrorRenderer |
errorRenderer
The error renderer to be utilized for error output of this input tag
|
protected java.util.List<ValidationError> |
fieldErrors
A list of the errors related to this input tag instance
|
pageContext, parentTag
Constructor and Description |
---|
InputTagSupport() |
Modifier and Type | Method and Description |
---|---|
void |
doCatch(java.lang.Throwable throwable)
Rethrows the passed in throwable in all cases.
|
abstract int |
doEndInputTag()
Abstract method implemented in child classes instead of doEndTag().
|
int |
doEndTag()
Final implementation of the doEndTag() method that allows the base InputTagSupport class
to insert functionality before and after the tag performs it's doEndTag equivalent
method.
|
void |
doFinally()
Used to ensure that the input tag is always removed from the tag stack so that there is
never any confusion about tag-parent hierarchies.
|
abstract int |
doStartInputTag()
Abstract method implemented in child classes instead of doStartTag().
|
int |
doStartTag()
Final implementation of the doStartTag() method that allows the base InputTagSupport class
to insert functionality before and after the tag performs it's doStartTag equivalent
method.
|
protected java.lang.String |
format(java.lang.Object input)
Calls
format(Object, boolean) with forOutput set to true. |
protected java.lang.String |
format(java.lang.Object input,
boolean forOutput)
Attempts to format an object using the Stripes formatting system.
|
ActionBean |
getActionBean()
Fetches the ActionBean associated with the form if one is present.
|
java.lang.String |
getDisabled() |
java.util.List<ValidationError> |
getFieldErrors()
Access for the field errors that occurred on the form input this tag represents
|
java.lang.String |
getFormatPattern()
Returns the value set with setFormatPattern()
|
java.lang.String |
getFormatType()
Returns the value set with setFormatAs()
|
java.lang.String |
getLocalizedFieldName()
Fetches the localized name for this field if one exists in the resource bundle.
|
protected java.lang.String |
getLocalizedFieldName(java.lang.String name)
Attempts to fetch a "field name" resource from the localization bundle.
|
java.lang.String |
getName() |
protected java.lang.Object |
getOverrideValueOrValues()
Gets the value for this tag based on the current population strategy.
|
FormTag |
getParentFormTag()
Locates the enclosing stripes form tag.
|
java.lang.String |
getReadonly()
Gets the HTML attribute of the same name.
|
protected java.lang.Object |
getSingleOverrideValue()
Returns a single value for the the value of this field.
|
java.lang.String |
getSize() |
protected ValidationMetadata |
getValidationMetadata() |
java.lang.Object |
getValueOnPage()
Used during repopulation to query the tag for a value of values provided to the tag
on the JSP.
|
boolean |
hasErrors()
Returns true if one or more validation errors exist for the field represented by
this input tag.
|
protected boolean |
isItemSelected(java.lang.Object value,
java.lang.Object selected)
Utility method for determining if a String value is contained within an Object, where the
object may be either a String, String[], Object, Object[] or Collection.
|
protected void |
loadErrors()
Find errors that are related to the form field this input tag represents and place
them in an instance variable to use during error rendering.
|
protected void |
makeFocused()
Writes out a JavaScript string to set focus on the field as it is rendered.
|
protected void |
registerWithParentForm()
Registers the field with the parent form within which it must be enclosed.
|
void |
setDisabled(java.lang.String disabled)
Checks to see if the value provided is either 'disabled' or a value that the
BooleanTypeConverter believes it true. |
void |
setFocus(boolean focus)
Informs the tag that it should render JavaScript to ensure that it is focused
when the page is loaded.
|
void |
setFormatPattern(java.lang.String formatPattern)
Sets the named format pattern, or a custom format pattern.
|
void |
setFormatType(java.lang.String formatType)
Sets the type of output to format, e.g.
|
void |
setName(java.lang.String name) |
void |
setReadonly(java.lang.String readonly)
Sets the value of the readonly attribute to "readonly" but only when the value passed
in is either "readonly" itself, or is converted to true by the
BooleanTypeConverter . |
void |
setSize(java.lang.String size) |
evaluateExpression, get, getAccesskey, getAttributes, getBodyContent, getBodyContentAsString, getCssClass, getDir, getId, getLang, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getStyle, getTabindex, getTitle, release, set, setAccesskey, setBodyContent, setClass, setCssClass, setDir, setDynamicAttribute, setId, setLang, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setStyle, setTabindex, setTitle, toString, writeAttributes, writeCloseTag, writeOpenTag, writeSingletonTag
getActionBeanType, getActionBeanUrl, getPageContext, getParent, getParentTag, getTagStack, popPageContextAttributes, pushPageContextAttributes, setPageContext, setParent
protected java.util.List<ValidationError> fieldErrors
protected TagErrorRenderer errorRenderer
public void setFormatType(java.lang.String formatType)
public java.lang.String getFormatType()
public void setFormatPattern(java.lang.String formatPattern)
public java.lang.String getFormatPattern()
protected java.lang.Object getOverrideValueOrValues() throws StripesJspException
StripesJspException
- if the enclosing form tag (which is required at all times, and
necessary to perform repopulation) cannot be locatedprotected java.lang.Object getSingleOverrideValue() throws StripesJspException
StripesJspException
- if the enclosing form tag (which is required at all times, and
necessary to perform repopulation) cannot be locatedpublic java.lang.Object getValueOnPage()
public FormTag getParentFormTag() throws StripesJspException
Locates the enclosing stripes form tag. If no form tag can be found, because the tag was not enclosed in one on the JSP, an exception is thrown.
StripesJspException
- if an enclosing form tag cannot be foundprotected boolean isItemSelected(java.lang.Object value, java.lang.Object selected)
value
- the value that we are searching forselected
- a String, String[], Object, Object[] or Collection (of scalars) denoting the
selected itemspublic java.lang.String getLocalizedFieldName() throws StripesJspException
StripesJspException
protected java.lang.String getLocalizedFieldName(java.lang.String name) throws StripesJspException
LocalizationUtility.getLocalizedFieldName(String, String, Class, java.util.Locale)
name
- the field name or resource to look upStripesJspException
protected ValidationMetadata getValidationMetadata() throws StripesJspException
StripesJspException
protected java.lang.String format(java.lang.Object input)
format(Object, boolean)
with forOutput
set to true.input
- The object to be formattedformat(Object, boolean)
protected java.lang.String format(java.lang.Object input, boolean forOutput)
input
- The object to be formattedforOutput
- If true, then the object will be formatted for output to the JSP. Currently,
that means that if encryption is enabled for the ActionBean property with the same
name as this tag then the formatted value will be encrypted before it is returned.protected void loadErrors() throws StripesJspException
StripesJspException
public java.util.List<ValidationError> getFieldErrors() throws StripesJspException
StripesJspException
public boolean hasErrors() throws StripesJspException
StripesJspException
public ActionBean getActionBean() throws StripesJspException
StripesJspException
public final int doStartTag() throws javax.servlet.jsp.JspException
TagErrorRenderer
if appropriate.doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class StripesTagSupport
javax.servlet.jsp.JspException
protected void registerWithParentForm() throws StripesJspException
StripesJspException
- if the parent form tag is not foundpublic abstract int doStartInputTag() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
public final int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class StripesTagSupport
javax.servlet.jsp.JspException
public void doCatch(java.lang.Throwable throwable) throws java.lang.Throwable
doCatch
in interface javax.servlet.jsp.tagext.TryCatchFinally
java.lang.Throwable
public void doFinally()
doFinally
in interface javax.servlet.jsp.tagext.TryCatchFinally
public void setFocus(boolean focus)
focus
- true if focus is desired, false otherwiseprotected void makeFocused() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
public abstract int doEndInputTag() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
public void setDisabled(java.lang.String disabled)
BooleanTypeConverter
believes it true. If so, adds a disabled attribute
to the tag, otherwise does not.public java.lang.String getDisabled()
public void setReadonly(java.lang.String readonly)
Sets the value of the readonly attribute to "readonly" but only when the value passed
in is either "readonly" itself, or is converted to true by the
BooleanTypeConverter
.
Although not all input tags support the readonly attribute, the method is located here because it is not a simple one-liner and is used by more than one tag.
public java.lang.String getReadonly()
public void setName(java.lang.String name)
public java.lang.String getName()
public void setSize(java.lang.String size)
public java.lang.String getSize()
? Copyright 2005-2006, Stripes Development Team.