org.sandev.generator.tags
Class FieldTagRange

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

public class FieldTagRange
extends AbstractSandFieldTag

Handle @sand.range declarations.

Declares a valid range for this numeric field using a match expression. See Persist.html under "How peristency is implemented" for an overview of match expressions.

Parameters: The match expression. Comments are not supported for this tag.


Field Summary
static java.lang.String CORENAME
          The core name of this tag.
static int EXPAND_JAVA
          use java standards for expanding the match expression
static int EXPAND_SQL
          use SQL92 standards for expanding the match expression
protected  java.lang.String fieldName
          The name of the field which had this range spec associated with it.
protected  java.lang.String matchExpr
          The match expression
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
FieldTagRange()
           
 
Method Summary
static boolean exists(com.sun.javadoc.FieldDoc fd)
          Returns true if the given field contains this tag, false otherwise.
 java.lang.String getExpandedExpression(java.lang.String value, int translation)
          Expand this range expression into a conditional expression by substituting in the given value as needed, and translating the conditional operators as needed.
 java.lang.String getFieldName()
          accessor for fieldName
static FieldTagRange getFieldTagRange(com.sun.javadoc.FieldDoc fd)
          Factory method for retrieving a new instance given a FieldDoc.
 java.lang.String getMatchExpr()
          accessor for matchExpr
 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 setFieldName(java.lang.String val)
          mutator for fieldName
 void setMatchExpr(java.lang.String val)
          mutator for matchExpr
 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

matchExpr

protected java.lang.String matchExpr
The match expression


fieldName

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


EXPAND_JAVA

public static final int EXPAND_JAVA
use java standards for expanding the match expression

See Also:
Constant Field Values

EXPAND_SQL

public static final int EXPAND_SQL
use SQL92 standards for expanding the match expression

See Also:
Constant Field Values

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

FieldTagRange

public FieldTagRange()
Method Detail

getMatchExpr

public java.lang.String getMatchExpr()
accessor for matchExpr


setMatchExpr

public void setMatchExpr(java.lang.String val)
mutator for matchExpr


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.


getExpandedExpression

public java.lang.String getExpandedExpression(java.lang.String value,
                                              int translation)
Expand this range expression into a conditional expression by substituting in the given value as needed, and translating the conditional operators as needed. This is pretty simplistic for now and doesn't deal with parentheses yet.


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.

getFieldTagRange

public static FieldTagRange getFieldTagRange(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.