|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--xdoclet.template.TemplateTagHandler
|
+--xdoclet.XDocletTagSupport
Derives from TemplateTagHandler and adds handy support methods for working with Javadoc Doclet classes.
| Field Summary | |
static int |
FOR_CLASS
|
static int |
FOR_CONSTRUCTOR
|
static int |
FOR_FIELD
|
static int |
FOR_METHOD
|
protected static java.lang.String |
PARAMETER_DELIMITER
Default delimiter used inside a xdoclet tag attribute. |
| Constructor Summary | |
XDocletTagSupport()
|
|
| Method Summary | |
static java.lang.String |
getClassTagValue(com.sun.javadoc.ClassDoc clazz,
java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
boolean superclasses,
boolean is_mandatory)
For classes. |
java.lang.String |
getClassTagValue(java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
boolean superclasses,
boolean is_mandatory)
For classes. |
protected static java.lang.String |
getConstructorTagValue(com.sun.javadoc.ConstructorDoc constructor,
java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
boolean is_mandatory)
For constructors. |
static com.sun.javadoc.ClassDoc |
getCurrentClass()
Provides the current class in the XDoclet build, or null if there is no current class. |
static com.sun.javadoc.ConstructorDoc |
getCurrentConstructor()
Provides the current constructor in the XDoclet build, or null if there is no current constructor. |
static com.sun.javadoc.FieldDoc |
getCurrentField()
Provides the current field in the XDoclet build, or null if there is no current field. |
static com.sun.javadoc.MethodDoc |
getCurrentMethod()
Provides the current method in the XDoclet build, or null if there is no current method. |
static com.sun.javadoc.PackageDoc |
getCurrentPackage()
Provides the current package in the XDoclet build, or null if there is no current package. |
static com.sun.javadoc.Tag |
getCurrentTag()
|
protected static DocletContext |
getDocletContext()
|
protected static java.lang.String |
getFieldTagValue(com.sun.javadoc.FieldDoc field,
java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
boolean is_mandatory)
For fields. |
protected java.lang.String |
getFieldTagValue(java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
boolean is_mandatory)
For fields. |
protected static java.lang.String |
getMethodTagValue(com.sun.javadoc.MethodDoc method,
java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
boolean is_mandatory)
For methods. |
protected java.lang.String |
getMethodTagValue(java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
boolean is_mandatory)
For methods. |
static java.lang.String |
getParameterValue(com.sun.javadoc.ClassDoc clazz,
java.lang.String value,
java.lang.String param_name,
int param_num)
Given the raw javadoc tag content as the value parameter parses it and searches for the specified parameter and if found returns its value, null otherwise. |
protected java.lang.String |
getParameterValue(java.lang.String value,
java.lang.String param_name,
int param_num)
Parses and searches the value string for the parameter named param_name and returns its value. |
protected static java.lang.String |
getTagValue(com.sun.javadoc.ProgramElementDoc prg_elem_doc,
java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
java.lang.String tn,
java.lang.String delimiter,
java.lang.String return_delimiters,
boolean superclasses,
int for_type,
boolean is_mandatory)
|
protected java.lang.String |
getTagValue(java.util.Properties attributes,
int for_type)
Return the Value of a tag specified in a Properties object. |
protected java.lang.String |
getTagValue(java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
java.lang.String tn,
java.lang.String delimiter,
java.lang.String return_delimiters,
boolean superclasses,
int for_type,
boolean is_mandatory)
|
protected static void |
invalidParamValueFound(com.sun.javadoc.ProgramElementDoc prg_elem_doc,
java.lang.String param_name,
java.lang.String tag_name,
java.lang.String value,
java.lang.String valid_values)
Throws an XDocletException exception to stop the build process. |
protected static void |
mandatoryParamNotFound(com.sun.javadoc.ProgramElementDoc prg_elem_doc,
java.lang.String param_name,
java.lang.String tag_name)
Throws an XDocletException exception to stop the build process. |
protected void |
mandatoryTemplateTagParamNotFound(java.lang.String template_tag_name,
java.lang.String param_name)
|
static void |
parsePropertyString(java.lang.String value,
java.util.Vector fragments,
java.util.Vector propertyRefs)
Parses a string containing ${xxx} style property references
into two lists. |
static com.sun.javadoc.ClassDoc |
popCurrentClass()
Pop the current class off the top of the class stack. |
static com.sun.javadoc.ClassDoc |
pushCurrentClass(com.sun.javadoc.ClassDoc clazz)
Push the specified class to the top of the current class stack making it effectively the current class. |
static java.lang.String |
replaceProperties(java.lang.String value,
java.util.Map keys)
Replaces ${xxx} style constructions in the given value with the
string value of the corresponding data types. |
static void |
setCurrentClass(com.sun.javadoc.ClassDoc clazz)
Sets current class to clazz by clearing currentClassStack stack and pushing clazz into top of it. |
static void |
setCurrentConstructor(com.sun.javadoc.ConstructorDoc constructor)
Set the current constructor. |
static void |
setCurrentField(com.sun.javadoc.FieldDoc field)
Set the current field. |
static void |
setCurrentMethod(com.sun.javadoc.MethodDoc method)
Set the current method. |
static void |
setCurrentPackage(com.sun.javadoc.PackageDoc pakkage)
Set the current package |
static void |
setCurrentTag(com.sun.javadoc.Tag currentTag)
|
protected static java.lang.String |
tokenizeValue(java.lang.String value,
java.lang.String tn,
java.lang.String delimiter,
java.lang.String return_delimiters)
Uses tokenNumber and delimiter to tokenize value and returns desired token |
| Methods inherited from class xdoclet.template.TemplateTagHandler |
generate, getContext, getEngine, getParser, setContext, setEngine, setParser |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int FOR_CLASS
public static final int FOR_METHOD
public static final int FOR_FIELD
public static final int FOR_CONSTRUCTOR
protected static final java.lang.String PARAMETER_DELIMITER
| Constructor Detail |
public XDocletTagSupport()
| Method Detail |
public static java.lang.String getParameterValue(com.sun.javadoc.ClassDoc clazz,
java.lang.String value,
java.lang.String param_name,
int param_num)
throws XDocletException
clazz - value - param_name - param_num - XDocletException - public static com.sun.javadoc.Tag getCurrentTag()
public static java.lang.String getClassTagValue(com.sun.javadoc.ClassDoc clazz,
java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
boolean superclasses,
boolean is_mandatory)
throws XDocletException
tag_name - Description of Parameterparam_name - Description of Parameterparam_num - Description of Parametervalid_values - Description of Parameterdefault_value - Description of Parametersuperclasses - Description of Parameteris_mandatory - Description of Parameterclazz - Description of ParameterXDocletException - Description of Exceptionpublic static com.sun.javadoc.MethodDoc getCurrentMethod()
setCurrentMethod(com.sun.javadoc.MethodDoc)public static com.sun.javadoc.FieldDoc getCurrentField()
setCurrentField(com.sun.javadoc.FieldDoc)public static com.sun.javadoc.ConstructorDoc getCurrentConstructor()
setCurrentConstructor(com.sun.javadoc.ConstructorDoc)public static com.sun.javadoc.ClassDoc getCurrentClass()
pushCurrentClass(com.sun.javadoc.ClassDoc),
popCurrentClass()public static com.sun.javadoc.PackageDoc getCurrentPackage()
public static void setCurrentMethod(com.sun.javadoc.MethodDoc method)
method - The method to make the current methodgetCurrentMethod()public static void setCurrentConstructor(com.sun.javadoc.ConstructorDoc constructor)
constructor - The constructor to make the current constructorgetCurrentConstructor()public static void setCurrentClass(com.sun.javadoc.ClassDoc clazz)
clazz - The new CurrentClass valuegetCurrentClass()public static void setCurrentPackage(com.sun.javadoc.PackageDoc pakkage)
pakkage - The new CurrentPackage valuegetCurrentPackage()public static void setCurrentTag(com.sun.javadoc.Tag currentTag)
public static void setCurrentField(com.sun.javadoc.FieldDoc field)
field - The field to make the current fieldgetCurrentMethod()
public static java.lang.String replaceProperties(java.lang.String value,
java.util.Map keys)
${xxx} style constructions in the given value with the
string value of the corresponding data types. NOTE: This method was taken
directly from Ant's source code (org.apache.tools.ant.ProjectHelper) and
modified slightly to use a Map instead of a Hashtable.value - The string to be scanned for property references. May be
null, in which case this method returns immediately with
no effect.keys - Mapping (String to String) of property names to their values.
Must not be null.null
if the original string is null.
public static void parsePropertyString(java.lang.String value,
java.util.Vector fragments,
java.util.Vector propertyRefs)
${xxx} style property references
into two lists. The first list is a collection of text fragments, while the
other is a set of string property names. null entries in the
first list indicate a property reference from the second list. NOTE: This
method was taken directly from Ant's source code
(org.apache.tools.ant.ProjectHelper) with the BuildException throwing
removed.value - Text to parse. Must not be null.fragments - List to add text fragments to. Must not be null
.propertyRefs - List to add property names to. Must not be null
.public static com.sun.javadoc.ClassDoc pushCurrentClass(com.sun.javadoc.ClassDoc clazz)
clazz - The class to push onto the top of the class stack.getCurrentClass(),
popCurrentClass()public static com.sun.javadoc.ClassDoc popCurrentClass()
getCurrentClass(),
pushCurrentClass(com.sun.javadoc.ClassDoc)protected static DocletContext getDocletContext()
protected static java.lang.String getTagValue(com.sun.javadoc.ProgramElementDoc prg_elem_doc,
java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
java.lang.String tn,
java.lang.String delimiter,
java.lang.String return_delimiters,
boolean superclasses,
int for_type,
boolean is_mandatory)
throws XDocletException
protected static java.lang.String getMethodTagValue(com.sun.javadoc.MethodDoc method,
java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
boolean is_mandatory)
throws XDocletException
tag_name - Description of Parameterparam_name - Description of Parameterparam_num - Description of Parametervalid_values - Description of Parameterdefault_value - Description of Parameteris_mandatory - Description of Parametermethod - Description of ParameterXDocletException - Description of Exception
protected static java.lang.String getFieldTagValue(com.sun.javadoc.FieldDoc field,
java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
boolean is_mandatory)
throws XDocletException
tag_name - Description of Parameterparam_name - Description of Parameterparam_num - Description of Parametervalid_values - Description of Parameterdefault_value - Description of Parameteris_mandatory - Description of Parameterfield - Description of ParameterXDocletException - Description of Exception
protected static java.lang.String getConstructorTagValue(com.sun.javadoc.ConstructorDoc constructor,
java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
boolean is_mandatory)
throws XDocletException
tag_name - Description of Parameterparam_name - Description of Parameterparam_num - Description of Parametervalid_values - Description of Parameterdefault_value - Description of Parameteris_mandatory - Description of Parameterconstructor - Description of ParameterXDocletException - Description of Exception
protected static java.lang.String tokenizeValue(java.lang.String value,
java.lang.String tn,
java.lang.String delimiter,
java.lang.String return_delimiters)
value - Description of Parametertn - Description of Parameterdelimiter - Description of Parameterreturn_delimiters - Description of Parameter
protected static void mandatoryParamNotFound(com.sun.javadoc.ProgramElementDoc prg_elem_doc,
java.lang.String param_name,
java.lang.String tag_name)
throws XDocletException
param_name - Description of Parametertag_name - Description of Parameterprg_elem_doc - Description of ParameterXDocletException - Description of Exception
protected static void invalidParamValueFound(com.sun.javadoc.ProgramElementDoc prg_elem_doc,
java.lang.String param_name,
java.lang.String tag_name,
java.lang.String value,
java.lang.String valid_values)
throws XDocletException
param_name - Description of Parametertag_name - Description of Parametervalue - Description of Parametervalid_values - Description of Parameterprg_elem_doc - Description of ParameterXDocletException - Description of Exception
public java.lang.String getClassTagValue(java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
boolean superclasses,
boolean is_mandatory)
throws XDocletException
tag_name - Description of Parameterparam_name - Description of Parameterparam_num - Description of Parametervalid_values - Description of Parameterdefault_value - Description of Parametersuperclasses - Description of Parameteris_mandatory - Description of ParameterXDocletException - Description of Exception
protected java.lang.String getParameterValue(java.lang.String value,
java.lang.String param_name,
int param_num)
throws XDocletException
value - Description of Parameterparam_name - Description of Parameterparam_num - Description of ParameterXDocletException - Description of Exception
protected java.lang.String getTagValue(java.util.Properties attributes,
int for_type)
throws XDocletException
attributes - The attributes of the template tagfor_type - 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 for_type is set to
FOR_METHOD or FOR_CONSTRUCTOR or FOR_FIELD, current method or field is
searched for the tag.XDocletException - Description of Exception
protected java.lang.String getMethodTagValue(java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
boolean is_mandatory)
throws XDocletException
tag_name - Description of Parameterparam_name - Description of Parameterparam_num - Description of Parametervalid_values - Description of Parameterdefault_value - Description of Parameteris_mandatory - Description of ParameterXDocletException - Description of Exception
protected java.lang.String getFieldTagValue(java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
boolean is_mandatory)
throws XDocletException
tag_name - Description of Parameterparam_name - Description of Parameterparam_num - Description of Parametervalid_values - Description of Parameterdefault_value - Description of Parameteris_mandatory - Description of ParameterXDocletException - Description of Exception
protected java.lang.String getTagValue(java.lang.String tag_name,
java.lang.String param_name,
int param_num,
java.lang.String valid_values,
java.lang.String default_value,
java.lang.String tn,
java.lang.String delimiter,
java.lang.String return_delimiters,
boolean superclasses,
int for_type,
boolean is_mandatory)
throws XDocletException
protected void mandatoryTemplateTagParamNotFound(java.lang.String template_tag_name,
java.lang.String param_name)
throws XDocletException
template_tag_name - param_name - XDocletException -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||