org.apache.beehive.netui.tags.html
Class FormatDate

Object
  extended by SimpleTagSupport
      extended by AbstractSimpleTag
          extended by FormatTag
              extended by FormatDate
All Implemented Interfaces:
JspTag, SimpleTag, INetuiTag

public class FormatDate
extends FormatTag

A formatter used to format dates. This formatter uses patterns that conform to java.text.SimpleDateFormat pattern syntax. Valid types for formatting are:

If the type is a String, we attempt to create a date out of the String. The String must be defined by a common format list below. If the string is equal the the empty string, it will be returned as the empty string. See java.text.SimpleDateFormat for more information.

The valid formats are:

Example
In this sample, the <netui:span> tag's output will be formatted to something like 08/29/1957.
    <netui:span value="${pageScope.today}">
        <netui:formatDate pattern="MM/dd/yyyy" />
    </netui:span>

Nested Class Summary
static class FormatDate.DateFormatter
          Internal FormatTag.Formatter which uses SimpleDateFormat.
 
Nested classes/interfaces inherited from class FormatTag
FormatTag.Formatter
 
Field Summary
 
Fields inherited from class FormatTag
_pattern
 
Constructor Summary
FormatDate()
           
 
Method Summary
 void doTag()
          Create the internal Formatter instance and perform the formatting.
 String getTagName()
          Return the name of the Tag.
 void setStringInputPattern(String inputPattern)
          Set the pattern to use to convert a String value into a date.
 
Methods inherited from class FormatTag
getLocale, setCountry, setLanguage, setPattern
 
Methods inherited from class AbstractSimpleTag
getBufferBody, getHtmlTag, getIdForTagId, getInlineError, getPageContext, getScriptReporter, getUserLocale, hasErrors, registerTagError, registerTagError, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write
 
Methods inherited from class SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatDate

public FormatDate()
Method Detail

getTagName

public String getTagName()
Return the name of the Tag.

Specified by:
getTagName in interface INetuiTag
Specified by:
getTagName in class AbstractSimpleTag
Returns:
the name of the tag.

setStringInputPattern

public void setStringInputPattern(String inputPattern)
                           throws JspException
Set the pattern to use to convert a String value into a date. This will be used before the common formats.

Parameters:
inputPattern - the pattern representing the string input
Throws:
JspException

doTag

public void doTag()
           throws JspException
Create the internal Formatter instance and perform the formatting.

Specified by:
doTag in interface SimpleTag
Overrides:
doTag in class SimpleTagSupport
Throws:
JspException - if a JSP exception has occurred