Derives from TemplateTagHandler and adds handy support methods for working with Javadoc Doclet classes.
FOR_CLASS
public static final int FOR_CLASS
- 0
FOR_CONSTRUCTOR
public static final int FOR_CONSTRUCTOR
- 3
FOR_FIELD
public static final int FOR_FIELD
- 2
FOR_METHOD
public static final int FOR_METHOD
- 1
PARAMETER_DELIMITER
protected static final String PARAMETER_DELIMITER
Default delimiter used inside a xdoclet tag attribute.
delimit
protected static String delimit(String attributeValue,
Properties attributes)
attributeValue
- Describe what the parameter doesattributes
- Describe what the parameter does
- Describe the return value
- fix the () equals test, it is not nice. Test : finder Home definition on AccountBean
expandClassName
protected static String expandClassName(String value,
Properties attributes)
getCurrentClassTag
public static XTag getCurrentClassTag()
- The current tag.
getCurrentConstructor
public static XConstructor getCurrentConstructor()
Provides the current constructor in the XDoclet build, or null if there is no current constructor.
- current constructor
setCurrentConstructor(XConstructor)
getCurrentField
public static XField getCurrentField()
Provides the current field in the XDoclet build, or null if there is no current field.
- current field
setCurrentField(XField)
getCurrentFieldTag
public static XTag getCurrentFieldTag()
- The current tag.
getCurrentMethod
public static XMethod getCurrentMethod()
Provides the current method in the XDoclet build, or null if there is no current method.
- current method
setCurrentMethod(XMethod)
getCurrentMethodTag
public static XTag getCurrentMethodTag()
- The current tag.
getCurrentPackage
public static XPackage getCurrentPackage()
Provides the current package in the XDoclet build, or null if there is no current package.
- current package
getDocletContext
protected static DocletContext getDocletContext()
- the context object casted to DocletContext
getEngine
public TemplateEngine getEngine()
Gets the Engine attribute of the TemplateTagHandler object.
- The Engine value
getExpandedDelimitedTagValue
protected static String getExpandedDelimitedTagValue(Properties attributes,
int forType)
throws XDocletException
The getExpandedDelimitedTagValue
method returns a delimited version with class names expanded if
requested of the tag value.
attributes
- a Properties
valueforType
- an int
value
- a
String
value
XDocletException
- if an error occurs
getTagValue
protected static String getTagValue(Properties attributes,
int forType)
throws XDocletException
Return the Value of a tag specified in a Properties object. This method work on the currentTag object variable,
matchs it against the XTag specified in the attributes Properties and returns the value of the specified tag.
attributes
- The attributes of the template tagforType
- if FOR_CLASS, then a fifth property superclasses is searched, if this is set to
true, then the tag is also searched in all superclasses of current class. If forType is set to FOR_METHOD or
FOR_CONSTRUCTOR or FOR_FIELD, current method or field is searched for the tag.
- The TagValue value
XDocletException
- Description of Exception
getTagValue
protected static String getTagValue(int forType,
String tagName,
String paramName,
String validValues,
String defaultValue,
boolean superclasses,
boolean mandatory)
throws XDocletException
Gets the TagValue attribute of the XDocletTagSupport class
forType
- Describe what the parameter doestagName
- Describe what the parameter doesparamName
- Describe what the parameter doesvalidValues
- Describe what the parameter doesdefaultValue
- Describe what the parameter doessuperclasses
- Describe what the parameter doesmandatory
- Describe what the parameter does
- The TagValue value
XDocletException
- Describe the exception
getTagValue
protected static String getTagValue(int forType,
XDoc doc,
String tagName,
String paramName,
String validValues,
String defaultValue,
boolean superclasses,
boolean mandatory)
throws XDocletException
forType
- doc
- Describe what the parameter doestagName
- Describe what the parameter doesparamName
- Describe what the parameter doesvalidValues
- Describe what the parameter doesdefaultValue
- Describe what the parameter doessuperclasses
- Describe what the parameter doesmandatory
- Describe what the parameter does
- The TagValue value
XDocletException
- Describe the exception
- (Aslak) maybe this method ought to be moved to xjavadoc.XDoc? Not a big deal though.
hasTag
protected static boolean hasTag(Properties attributes,
int forType)
throws XDocletException
A utility method used by ifHasClassTag/ifDoesntHaveClassTag and ifHasMethodTag/ifDoesntHaveMethodTag, return true
if at least one tag exists with the specified name.
attributes
- The attributes of the template tagforType
-
true
if matching tag found
XDocletException
- Description of Exception
isTagValueEqual
protected static boolean isTagValueEqual(Properties attributes,
int forType)
throws XDocletException
A utility method used by ifMethodTagValueEquals/ifMethodTagValueNotEquals and
ifClassTagValueEquals/ifClassTagValueNotEquals, return true if the value of the tag/XParameter equals with value.
attributes
- The attributes of the template tagforType
- Describe what the parameter does
- Description of the Returned Value
XDocletException
- Description of Exception
mandatoryParamNotFound
protected static void mandatoryParamNotFound(XDoc doc,
String paramName,
String tagName)
throws XDocletException
Throws an XDocletException exception to stop the build process. The exception has an informative message to help
user find out the cause of the error (not specifying a mandatory parameter for a tag).
doc
- member javadoc referenceparamName
- tag parameter nametagName
- tag name
XDocletException
- Description of Exception
mandatoryTemplateTagParamNotFound
protected void mandatoryTemplateTagParamNotFound(String templateTagName,
String paramName)
throws XDocletException
Throws an XDocletException exception to stop the build process. The exception has an informative message to help
user find out the cause of the error (omitting a mandatory parameter on a tag).
templateTagName
- tag nameparamName
- tag parameter name
XDocletException
-
modifiers
protected String modifiers(int forType)
throws XDocletException
Return the modifiers (static, private, etc.) for the current program element of the specified type.
forType
- FOR_XXX type constant
- modifiers
XDocletException
- Describe the exception
pushCurrentClass
public static XClass pushCurrentClass(XClass clazz)
Push the specified class to the top of the current class stack making it effectively the current class.
clazz
- The class to push onto the top of the class stack.
- The class on the top of the stack.
getCurrentClass()
, popCurrentClass()
setCurrentClass
public static void setCurrentClass(XClass clazz)
Sets current class to clazz
by clearing currentClassStack
stack and pushing clazz
into top of it.
clazz
- The class to make the current class
getCurrentClass()
setCurrentClassTag
public static void setCurrentClassTag(XTag currentTag)
Sets the current class tag.
currentTag
- The tag to make the current class tag
setCurrentConstructor
public static void setCurrentConstructor(XConstructor constructor)
Set the current constructor.
constructor
- The constructor to make the current constructor
getCurrentConstructor()
setCurrentField
public static void setCurrentField(XField field)
Set the current field.
field
- The field to make the current field
getCurrentField()
setCurrentFieldTag
public static void setCurrentFieldTag(XTag currentTag)
Sets the current field tag.
currentTag
- The tag to make the current field tag
setCurrentMethod
public static void setCurrentMethod(XMethod method)
Set the current method.
method
- The method to make the current method
getCurrentMethod()
setCurrentMethodTag
public static void setCurrentMethodTag(XTag currentTag)
Sets the current method tag.
currentTag
- The tag to make the current method tag
setCurrentPackage
public static void setCurrentPackage(XPackage pakkage)
Set the current package.
pakkage
- The package to make the current package
getCurrentPackage()