org.apache.taglibs.datetime
Class FormatTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.apache.taglibs.datetime.FormatTag
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag

public final class FormatTag
extends javax.servlet.jsp.tagext.BodyTagSupport

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
FormatTag()
           
 
Method Summary
 int doAfterBody()
          Method called at end of format tag body.
 int doEndTag()
          Method called at end of Tag
 int doStartTag()
          Method called at start of tag, always returns EVAL_BODY_TAG
 void release()
           
 void setDate(Date date)
          Set the date to use (overrides tag body) for formatting
 void setDefault(String default_text)
          Set the default text if an invalid date or no tag body is given
 void setLocale(short flag)
          Locale flag, if set to true, format date for client's preferred locale if known.
 void setLocaleRef(String value)
          Provides a key to search the page context for in order to get the java.util.Locale to use.
 void setPattern(String str)
          Set the pattern to use when formatting Date.
 void setPatternId(String str)
          Set the pattern to use when parsing Date using a script variable attribute.
 void setSymbolsRef(String symbolsRef)
          Provides a key to search the page context for in order to get the java.text.DateFormatSymbols to use
 void setTimeZone(String tz)
          Set the time zone to use when formatting date.
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Constructor Detail

FormatTag

public FormatTag()
Method Detail

doStartTag

public final int doStartTag()
                     throws javax.servlet.jsp.JspException
Method called at start of tag, always returns EVAL_BODY_TAG

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
EVAL_BODY_TAG
Throws:
javax.servlet.jsp.JspException

doAfterBody

public final int doAfterBody()
                      throws javax.servlet.jsp.JspException
Method called at end of format tag body.

Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Overrides:
doAfterBody in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
SKIP_BODY
Throws:
javax.servlet.jsp.JspException

doEndTag

public final int doEndTag()
                   throws javax.servlet.jsp.JspException
Method called at end of Tag

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
EVAL_PAGE
Throws:
javax.servlet.jsp.JspException

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.BodyTagSupport

setLocale

public final void setLocale(short flag)
Locale flag, if set to true, format date for client's preferred locale if known.

Parameters:
boolean - use users locale, true or false

setTimeZone

public final void setTimeZone(String tz)
Set the time zone to use when formatting date. Value must be the name of a timeZone tag script variable ID.

Parameters:
String - name of timeZone to use

setPattern

public final void setPattern(String str)
Set the pattern to use when formatting Date.

Parameters:
String - SimpleDateFormat style time pattern format string

setPatternId

public final void setPatternId(String str)
Set the pattern to use when parsing Date using a script variable attribute.

Parameters:
String - name of script variable attribute id

setDate

public final void setDate(Date date)
Set the date to use (overrides tag body) for formatting

Parameters:
Date - to use for formatting (could be null)

setDefault

public final void setDefault(String default_text)
Set the default text if an invalid date or no tag body is given

Parameters:
String - to use as default text

setLocaleRef

public void setLocaleRef(String value)
Provides a key to search the page context for in order to get the java.util.Locale to use.

Parameters:
String - name of locale attribute to use

setSymbolsRef

public void setSymbolsRef(String symbolsRef)
Provides a key to search the page context for in order to get the java.text.DateFormatSymbols to use

Parameters:
symbolsRef -


Copyright © 2012 Railo