org.sandev.generator.tags
Class StructTagSummaryfields

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

public class StructTagSummaryfields
extends AbstractSandStructTag

Handle the @sand.summaryfields declaration.

Declares one or more fields which will be used to form a summary description. A summary description is used when displaying a collection of instances, and to provide human-readable navigational linkage in a UI. The names of the fields, together with their values are made available in the raw UI display output, which is then transformed to provide the finished display.

Refer to the UI documentation for more information on transforms. Refer to each UIFormAdaptor implementation for details on the raw field and value format. Typically the field names and values are delimited to facilitate parsing, and have reasonable initial display values for enums and dates.

Not all the fields specified in this declaration will necessarily be used in a UI. They may be filtered out based on context, space considerations, or other reasons. It is recommended that the summary display fields be specified in priority order.

If no fields are specified for a summary, then for a persistent message the uniqueID is used. Otherwise the first declared field is used. If a struct has no fields, then this method will return an empty array, and what happens in the UI is indeterminate. The expectation is that all struct declarations will have at least one data field.

It is NOT valid to specify the name of an array field.

Note that the specified field names are not checked for syntax, they are simply text substituted, with values retrieved as needed using "get" + the capitalized field name for the accessor method. By convention, a generator may process any declaration containing parentheses directly as a method call (field parsing is still whitespace delimited however, so use this escape hatch with caution).

parameters: One or more field (data member) names separated by whitespace.
This tag does not support comments.


Field Summary
static java.lang.String CORENAME
          The core name of this tag.
protected  java.lang.String[] fieldNames
          The array of field names
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
StructTagSummaryfields()
           
 
Method Summary
static boolean exists(com.sun.javadoc.ClassDoc fd)
          Returns true if the given field contains this tag, false otherwise.
 java.lang.String[] getFieldNames()
          accessor for fieldNames
 java.lang.String getName()
          Return our tag name
static StructTagSummaryfields getStructTagSummaryfields(com.sun.javadoc.ClassDoc cd)
          Factory method for retrieving a new instance given a ClassDoc.
 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 setFieldNames(java.lang.String[] names)
          mutator for fieldNames
 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.AbstractSandClassTag
inType
 
Methods inherited from class org.sandev.generator.tags.AbstractSandBaseTag
inConstructor, inField, inMethod, inOverview, inPackage, 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

fieldNames

protected java.lang.String[] fieldNames
The array of field names


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

StructTagSummaryfields

public StructTagSummaryfields()
Method Detail

getFieldNames

public java.lang.String[] getFieldNames()
accessor for fieldNames


setFieldNames

public void setFieldNames(java.lang.String[] names)
mutator for fieldNames


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.

getStructTagSummaryfields

public static StructTagSummaryfields getStructTagSummaryfields(com.sun.javadoc.ClassDoc cd)
Factory method for retrieving a new instance given a ClassDoc. Returns an initialized instance in all cases. If there are fields declared, then that's what's get used. Otherwise if there are no fields declared, then we use the uniqueID for a persistent message, or the first declared field otherwise.


exists

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