org.sandev.generator.tags
Class FieldTagRef

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

public class FieldTagRef
extends AbstractSandFieldTag

Handle @sand.ref declarations.

Declares this field value uniquely identifies another struct instance. This tag may be used with either long or String field types but with different semantics:

A long reference must be a positive integer. Any value below Persister. TEMPIDTHRESHOLD is understood to be a reference to an instance which has not yet been added to persistent storage. Temporary values are remapped by the DataManager when processing an AggregateUpdate.

For a long reference a value of zero is understood to be null. Negative values are all invalid, with -1 used as the standard invalid value indicator. Unless explicitely specified, the default value is zero.

In both cases standard array semantics apply: an array of references can be empty but not null.

parameters:

  1. the referenceKey
  2. comment (optional)


Field Summary
protected  boolean array
          True if this field is an array, false otherwise.
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 ref associated with it.
protected  java.lang.String fieldType
          The type of the field which had this ref associated with it.
protected  java.lang.String refKey
          The reference key
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
FieldTagRef()
           
 
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 FieldTagRef getFieldTagRef(com.sun.javadoc.FieldDoc fd)
          Factory method for retrieving a new instance given a FieldDoc.
 java.lang.String getFieldType()
          accessor for fieldType
 java.lang.String getName()
          Return our tag name
 java.lang.String getRefFieldName()
          Return the name of the field in the referenced object which is used as a key reference.
 java.lang.String getRefKey()
          accessor for refKey
 java.lang.String getRefLongMessageClassName()
          Return the fully qualified class name of the referenced message.
 java.lang.String getRefShortMessageClassName()
          Return the short class name of the referenced message.
 void init(com.sun.javadoc.Tag tag)
          Initialize this instance from the tag information.
 boolean isArray()
          accessor for array
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 setArray(boolean val)
          mutator for array
 void setComment(java.lang.String text)
          mutator for comment
 void setFieldName(java.lang.String val)
          mutator for fieldName
 void setFieldType(java.lang.String val)
          mutator for fieldType
 void setRefKey(java.lang.String val)
          mutator for refKey
 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

refKey

protected java.lang.String refKey
The reference key


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 ref 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.


fieldType

protected java.lang.String fieldType
The type of the field which had this ref 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.


array

protected boolean array
True if this field is an array, false otherwise. This information is only available when fieldName is 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

FieldTagRef

public FieldTagRef()
Method Detail

getRefKey

public java.lang.String getRefKey()
accessor for refKey


setRefKey

public void setRefKey(java.lang.String val)
mutator for refKey


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


getFieldType

public java.lang.String getFieldType()
accessor for fieldType


setFieldType

public void setFieldType(java.lang.String val)
mutator for fieldType


isArray

public boolean isArray()
accessor for array


setArray

public void setArray(boolean val)
mutator for array


init

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


getRefShortMessageClassName

public java.lang.String getRefShortMessageClassName()
Return the short class name of the referenced message.


getRefLongMessageClassName

public java.lang.String getRefLongMessageClassName()
Return the fully qualified class name of the referenced message. The reference key is declared using the struct class name, this method does text substitution to translate into the message class name.


getRefFieldName

public java.lang.String getRefFieldName()
Return the name of the field in the referenced object which is used as a key reference. For a long reference this method returns "uniqueID". For a String reference this method returns the name of the key field, which is the last part of the reference key declaration.


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.

getFieldTagRef

public static FieldTagRef getFieldTagRef(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.