public class FormatTag extends VarTagSupport
Formatter
. The resulting String
can be assigned in the page,
request, session or application scopes by using "var" and "scope" or it can
be written directly to the JSP output.scope, var
pageContext, parentTag
Constructor and Description |
---|
FormatTag() |
Modifier and Type | Method and Description |
---|---|
int |
doEndTag()
Abstract method from the Tag interface.
|
int |
doStartTag()
Abstract method from the Tag interface.
|
protected java.lang.String |
format(java.lang.Object value)
Attempts to format an object using an appropriate
Formatter . |
java.lang.String |
getFormatPattern()
Get the format pattern
|
java.lang.String |
getFormatType()
Get the format type
|
java.lang.Object |
getValue()
Get the object to be formatted
|
void |
setFormatPattern(java.lang.String formatPattern)
Set the format pattern
|
void |
setFormatType(java.lang.String formatType)
Set the format type
|
void |
setValue(java.lang.Object value)
Set the object to be formatted
|
protected void |
writeOut(java.lang.Object value)
Calls
format(Object) and writes the resulting String to
the JSP output. |
export, getScope, getVar, setScope, setVar
getActionBeanType, getActionBeanUrl, getPageContext, getParent, getParentTag, getTagStack, popPageContextAttributes, pushPageContextAttributes, release, setPageContext, setParent
public java.lang.String getFormatPattern()
public void setFormatPattern(java.lang.String formatPattern)
public java.lang.String getFormatType()
public void setFormatType(java.lang.String formatType)
public java.lang.Object getValue()
public void setValue(java.lang.Object value)
protected java.lang.String format(java.lang.Object value)
Formatter
. If
no formatter is available for the object, then this method will call
toString()
on the object. A null value
will
be formatted as an empty string.value
- the object to be formattedprotected void writeOut(java.lang.Object value) throws javax.servlet.jsp.JspException
format(Object)
and writes the resulting String
to
the JSP output.value
- the object to be formatted and writtenjavax.servlet.jsp.JspException
public int doStartTag() throws javax.servlet.jsp.JspException
StripesTagSupport
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class StripesTagSupport
javax.servlet.jsp.JspException
public int doEndTag() throws javax.servlet.jsp.JspException
StripesTagSupport
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class StripesTagSupport
javax.servlet.jsp.JspException
? Copyright 2005-2006, Stripes Development Team.