org.sandev.generator.tags
Class FieldTagStringlength

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

public class FieldTagStringlength
extends AbstractSandFieldTag

Handle @sand.stringlength declarations.

Declares a normal and a maximum character length for this String data member. The normal length is used as a guideline for display formatting and similar purposes. Any values longer than the maximum are considered invalid and may be truncated automatically during processing as needed.

parameters:

  1. the normal string length in characters (positive integer value)
  2. the maximum string length in characters (positive integer value)
  3. comment (optional)


Field Summary
protected  java.lang.String comment
          Any comment text that was specified for this tag declaration
static java.lang.String CORENAME
          The core name of this tag.
protected  java.lang.String fieldName
          The name of the field which had this stringlength associated with it.
protected  java.lang.String maxLengthStr
          The declared normal length
protected  java.lang.String normLengthStr
          The declared normal length
static java.lang.String TAGNAME
          Our fixed name, used for hash lookup and text parsing.
 
Fields inherited from class org.sandev.generator.tags.AbstractSandBaseTag
PREFIX
 
Constructor Summary
FieldTagStringlength()
           
 
Method Summary
static boolean exists(com.sun.javadoc.FieldDoc fd)
          Returns true if the given field contains this tag, false otherwise.
 java.lang.String getComment()
          accessor for comment
 java.lang.String getFieldName()
          accessor for fieldName
static FieldTagStringlength getFieldTagStringlength(com.sun.javadoc.FieldDoc fd)
          Factory method for retrieving a new instance given a FieldDoc.
 int getMaxLength()
          Return the maximum length as an integer.
 java.lang.String getMaxLengthStr()
          accessor for maxLengthStr
 java.lang.String getName()
          Return our tag name
 int getNormLength()
          Return the normal length as an integer.
 java.lang.String getNormLengthStr()
          accessor for normLengthStr
 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 setComment(java.lang.String text)
          mutator for comment
 void setFieldName(java.lang.String val)
          mutator for fieldName
 void setMaxLengthStr(java.lang.String val)
          mutator for maxLengthStr
 void setNormLengthStr(java.lang.String val)
          mutator for normLengthStr
 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

normLengthStr

protected java.lang.String normLengthStr
The declared normal length


maxLengthStr

protected java.lang.String maxLengthStr
The declared normal length


comment

protected java.lang.String comment
Any comment text that was specified for this tag declaration


fieldName

protected java.lang.String fieldName
The name of the field which had this stringlength 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

FieldTagStringlength

public FieldTagStringlength()
Method Detail

getNormLengthStr

public java.lang.String getNormLengthStr()
accessor for normLengthStr


setNormLengthStr

public void setNormLengthStr(java.lang.String val)
mutator for normLengthStr


getMaxLengthStr

public java.lang.String getMaxLengthStr()
accessor for maxLengthStr


setMaxLengthStr

public void setMaxLengthStr(java.lang.String val)
mutator for maxLengthStr


getComment

public java.lang.String getComment()
accessor for comment


setComment

public void setComment(java.lang.String text)
mutator for comment


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.


getNormLength

public int getNormLength()
Return the normal length as an integer. Note that a normal length can be defined as the value of another constant, at which point this method will only work if that constant is known at build time. Typically only system constants are known at build time, and other declarations will fail, so use this method with caution.


getMaxLength

public int getMaxLength()
Return the maximum length as an integer. Note that a maximum length can be defined as the value of another constant, at which point this method will only work if that constant is known at build time. Typically only system constants are known at build time, and other declarations will fail, so use this method with caution.


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.

getFieldTagStringlength

public static FieldTagStringlength getFieldTagStringlength(com.sun.javadoc.FieldDoc fd)
Factory method for retrieving a new instance given a FieldDoc. Returns an initialized instance if the tag was found, an instance with default values if this is a String field with no tag, and null otherwise.

The default values shouldn't matter since the stringlength for any field should always be declared.


exists

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