org.sandev.generator.tags
Class FieldTagDateFormat

java.lang.Object
  extended by org.sandev.generator.tags.AbstractSandBaseTag
      extended by org.sandev.generator.tags.AbstractSandFieldTag
          extended by org.sandev.generator.tags.FieldTagDateFormat
All Implemented Interfaces:
com.sun.tools.doclets.Taglet

public class FieldTagDateFormat
extends AbstractSandFieldTag

Handle @sand.dateformat declarations.

Declares a display and optional edit format to use for this Date field, following the coding of java.text.SimpleDateFormat. The first parameter is a quoted string representing the formatting to use for display. A second string may be specified for use during editing, since often the user input a shorter format than the main display. If no edit format is specified, then the display format is used for both.

An optional third parameter TimeZone identifier may be used to specify the TimeZone used for date translation. Normally all dates are server time, but it is sometimes necessary to store a date using a different timezone such as "Etc/UTC". If a timezone id is specified, then the display and edit formats must also be specifed. This keeps the parsing unambiguous, but also recognizes that the default locale formatting for the server may not be correct if the timezone is being overridden.

Comments are not supported for this tag.

parameters:

  1. quoted date format string for display of the date value
  2. quoted date format string for use in editing the date value
  3. TimeZone id


Field Summary
static java.lang.String CORENAME
          The core name of this tag.
protected  java.lang.String displayFormat
          The format string to use for display.
protected  java.lang.String editFormat
          The format string to use for editing.
protected  java.lang.String fieldName
          The name of the field which had this dateformat associated with it.
static java.lang.String TAGNAME
          Our fixed name, used for hash lookup and text parsing.
protected  java.lang.String timeZoneID
          The format string to use for editing.
 
Fields inherited from class org.sandev.generator.tags.AbstractSandBaseTag
PREFIX
 
Constructor Summary
FieldTagDateFormat()
           
 
Method Summary
static boolean exists(com.sun.javadoc.FieldDoc fd)
          Returns true if the given field contains this tag, false otherwise.
 java.lang.String getDisplayFormat()
          accessor for displayFormat
 java.lang.String getEditFormat()
          accessor for editFormat
 java.lang.String getFieldName()
          accessor for fieldName
static FieldTagDateFormat getFieldTagDateFormat(com.sun.javadoc.FieldDoc fd)
          Factory method for retrieving a new instance given a FieldDoc.
 java.lang.String getName()
          Return our tag name
 java.lang.String getTimeZoneID()
          accessor for timeZoneID
 void init(com.sun.javadoc.Tag tag)
          Initialize this instance from the tag information.
static void register(java.util.Map tagletMap)
          Registers this taglet when triggered by the taglet declaration being loaded in as part of the build.
 void setDisplayFormat(java.lang.String val)
          mutator for displayFormat
 void setEditFormat(java.lang.String val)
          mutator for editFormat
 void setFieldName(java.lang.String val)
          mutator for fieldName
 void setTimeZoneID(java.lang.String val)
          mutator for timeZoneID
 java.lang.String toString(com.sun.javadoc.Tag tag)
          Return a documentation description of this tag.
 java.lang.String toString(com.sun.javadoc.Tag[] tags)
          Return the documentation text for when several of these tags are present.
 
Methods inherited from class org.sandev.generator.tags.AbstractSandFieldTag
inField
 
Methods inherited from class org.sandev.generator.tags.AbstractSandBaseTag
inConstructor, inMethod, inOverview, inPackage, inType, isInlineTag, registerHelper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CORENAME

public static final java.lang.String CORENAME
The core name of this tag.

See Also:
Constant Field Values

displayFormat

protected java.lang.String displayFormat
The format string to use for display.


editFormat

protected java.lang.String editFormat
The format string to use for editing.


timeZoneID

protected java.lang.String timeZoneID
The format string to use for editing.


fieldName

protected java.lang.String fieldName
The name of the field which had this dateformat associated with it. Note that field information is only available when this instance had access to the FieldDoc. If you initialize an instance of this class from only the tags (such as in a taglet), then this information is not available.


TAGNAME

public static final java.lang.String TAGNAME
Our fixed name, used for hash lookup and text parsing.

See Also:
Constant Field Values
Constructor Detail

FieldTagDateFormat

public FieldTagDateFormat()
Method Detail

getDisplayFormat

public java.lang.String getDisplayFormat()
accessor for displayFormat


setDisplayFormat

public void setDisplayFormat(java.lang.String val)
mutator for displayFormat


getEditFormat

public java.lang.String getEditFormat()
accessor for editFormat


setEditFormat

public void setEditFormat(java.lang.String val)
mutator for editFormat


getTimeZoneID

public java.lang.String getTimeZoneID()
accessor for timeZoneID


setTimeZoneID

public void setTimeZoneID(java.lang.String val)
mutator for timeZoneID


getFieldName

public java.lang.String getFieldName()
accessor for fieldName


setFieldName

public void setFieldName(java.lang.String val)
mutator for fieldName


init

public void init(com.sun.javadoc.Tag tag)
Initialize this instance from the tag information.


getName

public java.lang.String getName()
Return our tag name


register

public static void register(java.util.Map tagletMap)
Registers this taglet when triggered by the taglet declaration being loaded in as part of the build.


toString

public java.lang.String toString(com.sun.javadoc.Tag tag)
Return a documentation description of this tag.

Specified by:
toString in interface com.sun.tools.doclets.Taglet
Specified by:
toString in class AbstractSandBaseTag
Parameters:
tag - the Tag representation of this custom tag.

toString

public java.lang.String toString(com.sun.javadoc.Tag[] tags)
Return the documentation text for when several of these tags are present.

Specified by:
toString in interface com.sun.tools.doclets.Taglet
Specified by:
toString in class AbstractSandBaseTag
Parameters:
tags - the array of Tags representing of this custom tag.

getFieldTagDateFormat

public static FieldTagDateFormat getFieldTagDateFormat(com.sun.javadoc.FieldDoc fd)
Factory method for retrieving a new instance given a FieldDoc. Returns an initialized instance if the tag was found, null otherwise.


exists

public static boolean exists(com.sun.javadoc.FieldDoc fd)
Returns true if the given field contains this tag, false otherwise.