org.sandev.generator.tags
Class FieldTagPrintname

java.lang.Object
  extended byorg.sandev.generator.tags.AbstractSandBaseTag
      extended byorg.sandev.generator.tags.AbstractSandFieldTag
          extended byorg.sandev.generator.tags.FieldTagPrintname
All Implemented Interfaces:
com.sun.tools.doclets.Taglet

public class FieldTagPrintname
extends AbstractSandFieldTag

Handle @sand.printname declarations.

Declares a print value to be used instead of the actual field name for display purposes, allowing the field name and print name to be changed independently. Typical use:

  • Non-localized system: Provides a quick way to get something better than the raw java field names out for display.
  • Localized system: Provides an alternate key to decouple translation and code changes.

    parameters:

    1. The print value for the field name


    Field Summary
    static java.lang.String CORENAME
              The core name of this tag.
    protected  java.lang.String printnameStr
              The declared print 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
    FieldTagPrintname()
               
     
    Method Summary
    static boolean exists(com.sun.javadoc.FieldDoc fd)
              Returns true if the given field contains this tag, false otherwise.
    static FieldTagPrintname getFieldTagPrintname(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 getPrintnameStr()
              accessor for printnameStr
     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 setPrintnameStr(java.lang.String val)
              mutator for printnameStr
     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

    printnameStr

    protected java.lang.String printnameStr
    The declared print value


    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

    FieldTagPrintname

    public FieldTagPrintname()
    Method Detail

    getPrintnameStr

    public java.lang.String getPrintnameStr()
    accessor for printnameStr


    setPrintnameStr

    public void setPrintnameStr(java.lang.String val)
    mutator for printnameStr


    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.

    getFieldTagPrintname

    public static FieldTagPrintname getFieldTagPrintname(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.