|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.sandev.generator.tags.AbstractSandBaseTag
org.sandev.generator.tags.AbstractSandClassTag
org.sandev.generator.tags.AbstractSandStructTag
org.sandev.generator.tags.StructTagFieldlayout
public class StructTagFieldlayout
Handle the @sand.fieldlayout declaration.
Declares a general layout for the fields in this struct using an XML notation of the general form
<fieldlayout>
<layrow><fieldA/><fieldB/></layrow>
<layrow><fieldC/></layrow>
</fieldlayout>
will cause the default display to have fieldA and fieldB in the first
row, fieldC in the second row, and any remaining fields authorized for
display after that using the default layout. The default layout is
one field per row (field + value = 1 row).
Implementation of attributes should be supported when practical. The defined attributes are:
The valprefix and valsuffix tags may be extended to allow for dynamic values retrieved via call to any static method accepting the UIFormAdaptorCallback reference, locale, message instance and field name. This is done by specifying $callback$ followed by an assignment operator followed by the fully qualified name of the method to be called. So for example: valprefix="$callback$=org.sandev.basic.SomeUtil.prefixMaker" would signal that the static prefixMaker method of the SomeUtil class should be called to retrieve the prefix value.
Unfortunately we do not have access to an XML parser at build time.
| Field Summary | |
|---|---|
protected java.lang.String |
classname
The name of the class that declared this layout. |
static java.lang.String |
CORENAME
The core name of this tag. |
protected java.lang.String |
layoutXML
The layout declaration XML. |
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 | |
|---|---|
StructTagFieldlayout()
|
|
| Method Summary | |
|---|---|
int |
compare(java.lang.Object obj1,
java.lang.Object obj2)
Compare two fields based on their declared layout ordering. |
int |
convertToInt(java.lang.String strval)
Convert the given string to an integer and return it. |
void |
debug(java.lang.String text)
Debug output utility. |
boolean |
endsRow(java.lang.String fieldname)
Return true if the given field ends a row, false otherwise. |
static boolean |
exists(com.sun.javadoc.ClassDoc cd)
Return true if the give struct contains this tag, false otherwise. |
int |
getAttrIntValue(char[] chars,
int index,
java.lang.String attrname)
Return the value of the specified attribute as an integer. |
java.lang.String |
getAttrStringValue(char[] chars,
int index,
java.lang.String attrname)
Return the value of the given attribute or null if not available. |
java.lang.String |
getClassname()
accessor for classname |
int |
getFieldAttrIntVal(java.lang.String fieldname,
java.lang.String attrname,
int failval)
Return the value of the attribute specified for the given fieldname or the failval if the attribute is not specified or cannot be converted to an int. |
java.lang.String |
getFieldAttrVal(java.lang.String fieldname,
java.lang.String attrname)
Return the value of the given attribute of the given field, or null if not found. |
int |
getFieldStartIndex(char[] chars,
java.lang.String fieldname)
Return the starting index for this attribute declaration. |
static StructTagFieldlayout |
getInstance(com.sun.javadoc.ClassDoc cd)
Factory method for retrieving a new instance given a ClassDoc. |
java.lang.String |
getLayoutXML()
accessor for layoutXML |
java.lang.String |
getLayoutXMLNoSpace()
Remove extraneous formatting space from the layoutXML and return the result. |
int |
getMaxCols()
Return the maximum number of columns used by the declared layout. |
java.lang.String |
getName()
Return our tag name |
java.lang.String |
getTagString(char[] chars,
int index)
Read from the given index to the the closing tag bracket and return the result. |
boolean |
hasAttr(char[] chars,
int index,
java.lang.String attrname)
Read forward from the given index searching for the given attrname. |
boolean |
hasField(java.lang.String fieldname)
Return true if the given layout includes the given fieldname, false otherwise. |
boolean |
hasFieldAttr(java.lang.String fieldname,
java.lang.String attrname)
Return true if the given field has the given attribute specified, false otherwise. |
boolean |
hasFieldlayout()
Returns true if there is a fieldlayout defined, false otherwise. |
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 |
setClassname(java.lang.String classname)
mutator for classname |
void |
setLayoutXML(java.lang.String layoutXML)
mutator for layoutXML |
boolean |
sharesRow(java.lang.String fieldname)
Return true if the given field shares a row with another field, false otherwise. |
void |
sort(com.sun.javadoc.FieldDoc[] fields)
Sort the given field array based on the declared field layout. |
boolean |
startsRow(java.lang.String fieldname)
Return true if the given field begins a row, false otherwise. |
boolean |
tokenMatch(char[] chars,
int index,
char[] tokchars)
Return true if the characters from the given index match the characters of the token string. |
boolean |
tokenMatch(char[] chars,
int index,
java.lang.String token)
Return true if the characters from the given index match the characters of the token string. |
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 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 |
| Methods inherited from interface java.util.Comparator |
|---|
equals |
| Field Detail |
|---|
public static final java.lang.String CORENAME
protected java.lang.String layoutXML
protected java.lang.String classname
public static final java.lang.String TAGNAME
| Constructor Detail |
|---|
public StructTagFieldlayout()
| Method Detail |
|---|
public java.lang.String getLayoutXML()
public void setLayoutXML(java.lang.String layoutXML)
public java.lang.String getClassname()
public void setClassname(java.lang.String classname)
public void init(com.sun.javadoc.Tag tag)
public java.lang.String getName()
getName in interface com.sun.tools.doclets.Tagletpublic static void register(java.util.Map tagletMap)
public java.lang.String toString(com.sun.javadoc.Tag tag)
toString in interface com.sun.tools.doclets.TaglettoString in class AbstractSandBaseTagtag - the Tag representation of this custom tag.public java.lang.String toString(com.sun.javadoc.Tag[] tags)
toString in interface com.sun.tools.doclets.TaglettoString in class AbstractSandBaseTagtags - the array of Tags representing of this custom tag.public static StructTagFieldlayout getInstance(com.sun.javadoc.ClassDoc cd)
public static boolean exists(com.sun.javadoc.ClassDoc cd)
public boolean hasFieldlayout()
public void sort(com.sun.javadoc.FieldDoc[] fields)
public int compare(java.lang.Object obj1,
java.lang.Object obj2)
compare in interface java.util.Comparatorpublic int getMaxCols()
public boolean tokenMatch(char[] chars,
int index,
java.lang.String token)
public boolean tokenMatch(char[] chars,
int index,
char[] tokchars)
public boolean hasAttr(char[] chars,
int index,
java.lang.String attrname)
public java.lang.String getAttrStringValue(char[] chars,
int index,
java.lang.String attrname)
public int getAttrIntValue(char[] chars,
int index,
java.lang.String attrname)
public int convertToInt(java.lang.String strval)
public java.lang.String getTagString(char[] chars,
int index)
public boolean hasField(java.lang.String fieldname)
public boolean hasFieldAttr(java.lang.String fieldname,
java.lang.String attrname)
public int getFieldStartIndex(char[] chars,
java.lang.String fieldname)
public java.lang.String getFieldAttrVal(java.lang.String fieldname,
java.lang.String attrname)
public int getFieldAttrIntVal(java.lang.String fieldname,
java.lang.String attrname,
int failval)
public boolean sharesRow(java.lang.String fieldname)
public boolean startsRow(java.lang.String fieldname)
public boolean endsRow(java.lang.String fieldname)
public void debug(java.lang.String text)
public java.lang.String getLayoutXMLNoSpace()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||