org.sandev.generator.tags
Class FieldTagInvalid

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

public class FieldTagInvalid
extends AbstractSandFieldTag

Handle @sand.invalid declarations.

Specify the value that will be used to mark an invalid value for this field. The default invalid values for each field type are:

If you set the default value for a field to be the invalid value, then you effectively force a value to be explicitely set. If any message fields are invalid, then message validation will fail, so the message will be invalid.

Note that invalid messages are allowed (otherwise how you can't fix them or display them), but they will be rejected by things like persistence processing that require validation.

The invalid value for an array is null. At runtime, arrays are never null, although they can be empty. When this tag is declared for an array field, it refers to the invalid value of an array element. Full array validation (such as ordering constraints, duplicates etc) is done in business logic, along with inter-field validation, uniqueness checking and any other checking above the syntax level.

parameters:

  1. the default value
  2. 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 invalidStr
          The declared invalid value
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
FieldTagInvalid()
           
 
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
static FieldTagInvalid getFieldTagInvalid(com.sun.javadoc.FieldDoc fd)
          Factory method for retrieving a new instance given a FieldDoc.
 java.lang.String getInvalidArrayStr()
          Get the invalid value for an array as a String.
 java.lang.String getInvalidStr()
          accessor for invalidStr
 java.lang.String getName()
          Return our tag name
 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 setInvalidStr(java.lang.String val)
          mutator for invalidStr
 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

invalidStr

protected java.lang.String invalidStr
The declared invalid value


comment

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


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

FieldTagInvalid

public FieldTagInvalid()
Method Detail

getInvalidStr

public java.lang.String getInvalidStr()
accessor for invalidStr


setInvalidStr

public void setInvalidStr(java.lang.String val)
mutator for invalidStr


getInvalidArrayStr

public java.lang.String getInvalidArrayStr()
Get the invalid value for an array as a String. This always returns "null".


getComment

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


setComment

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


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.

getFieldTagInvalid

public static FieldTagInvalid getFieldTagInvalid(com.sun.javadoc.FieldDoc fd)
Factory method for retrieving a new instance given a FieldDoc. Returns an initialized instance of the tag in all cases.


exists

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