currentMethodName
public String currentMethodName()
throws XDocletException
Returns the current method name. Used inside block elements.
- method name
XDocletException
- Description of Exception
exceptionList
public String exceptionList(Properties attributes)
throws XDocletException
Iterates over all exceptions thrown by the current method and returns a string containing definition of all those
exceptions.
attributes
- The attributes of the template tag
- Description of the Returned Value
XDocletException
- Description of Exception
- type = "block"
- name = "method"
optional = "true"
description = "The method name of which exceptions list
is extracted. If not specified then current method is used."
- name = "skip"
optional = "true"
description = "A comma-separated list of exceptions that
should be skipped and not put into the list."
- name = "append"
optional = "true"
description = "A comma-separated list of exceptions that
should be always appended regardless if current method has that method defined or not."
executeAndRestoreMethod
public void executeAndRestoreMethod(String template,
Properties attributes)
throws XDocletException
Evaluate the current block, and then restore the current method before continuing.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
firstSentenceDescriptionOfCurrentMethod
public String firstSentenceDescriptionOfCurrentMethod()
throws XDocletException
Return standard javadoc of current method.
- Description of the Returned Value
XDocletException
- Description of Exception
- type = "content"
forAllClassMethods
public void forAllClassMethods(String template,
Properties attributes)
throws XDocletException
Loops through all methods for all classes after first sorting all the methods.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
- name = "type"
optional = "true"
description = "For all classes by the type."
- name = "extent"
optional = "true"
values = "concrete-type,superclass,hierarchy"
description = "Specifies the extent of the type search. If concrete-type then only check the concrete type, if
superclass then check also superclass, if hierarchy then search the whole hierarchy and find if the class is
of the specified type. Default is hierarchy."
forAllMethodTagTokens
public void forAllMethodTagTokens(String template,
Properties attributes)
throws XDocletException
Iterates over all tokens in current method tag with the name tagName and evaluates the body for every token.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
- name = "tagName"
optional = "false"
description = "The tag name."
- name = "delimiter"
description = "delimiter for the StringTokenizer. consult javadoc for
java.util.StringTokenizer default is ','"
- name = "skip"
description = "how many tokens to skip on start"
forAllMethodTags
public void forAllMethodTags(String template,
Properties attributes)
throws XDocletException
Iterates over all tags of current method and evaluates the body of the tag for each method.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
- name = "tagName"
optional = "false"
description = "The tag name."
forAllMethods
public void forAllMethods(String template,
Properties attributes)
throws XDocletException
Iterates over all methods of current class and evaluates the body of the tag for each method.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
- name = "superclasses"
optional = "true"
values = "true,false"
description = "If true then
traverse superclasses also, otherwise look up the tag in current concrete class only."
- name = "sort"
optional = "true"
values = "true,false"
description = "If true then sort the
methods list."
getMethodNameWithoutPrefixFor
public static String getMethodNameWithoutPrefixFor(XMethod currentMethod)
Merge with modified SubTask.methodNameWithoutPrefix
currentMethod
- Description of Parameter
- Description of the Returned Value
getMethodTypeFor
public static String getMethodTypeFor(XMethod method)
getPropertyNameFor
public static String getPropertyNameFor(XMethod method)
Gets the PropertyNameFor attribute of the MethodTagsHandler class
method
- Describe what the parameter does
- The PropertyNameFor value
getTransformedMethodTypeFor
public static String getTransformedMethodTypeFor(XMethod method)
getterPrefix
public String getterPrefix()
throws XDocletException
Returns 'get' or 'is' getter prefix part of the current method. Returns empty string if the method doesn't start
with either of the two getter prefixes.
- Description of the Returned Value
XDocletException
- Description of Exception
- type = "content"
hasMethod
public static boolean hasMethod(XClass clazz,
String methodName,
String[] parameters,
boolean setCurrentMethod)
throws XDocletException
Returns true if a method with the specified methodName+parameters is found in the class clazz. The parameters
array can be empty, if so any method with any set of parameters is considered equal to the method we're searching
for. if not empty all parameters of the method must be equal to the ones specified in parameters array to have
"method equality".
clazz
- Description of ParametermethodName
- Description of Parameterparameters
- Description of ParametersetCurrentMethod
-
- Description of the Returned Value
XDocletException
-
ifDoesntHaveMethod
public void ifDoesntHaveMethod(String template,
Properties attributes)
throws XDocletException
Evaluate the body if current class doesn't have a method with the specified name+parameters. If parameters not
specified then any method with the given name and any set of parameters is considered equal to the given method
name and so the test result is positive and the body is evaluated.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
ifHasMethod(java.lang.String,java.util.Properties)
- type = "block"
- name = "name"
optional = "false"
description = "The name of the method we're searching for
its existence in current class."
- name = "parameters"
optional = "true"
description = "We're searching for a method that has
the exact set of parameters specified in parameters param."
- name = "delimiter"
optional = "true"
description = "The parameters param is delimited by
the string specified in delimiter parameter."
ifDoesntHaveMethodTag
public void ifDoesntHaveMethodTag(String template,
Properties attributes)
throws XDocletException
Evaluates the body if current method doesn't have at least one tag with the specified name.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
- name = "tagName"
optional = "false"
description = "The tag name."
- name = "paramName"
description = "The parameter name. If not specified, then the raw
content of the tag is returned."
- name = "paramNum"
description = "The zero-based parameter number. It's used if the user
used the space-separated format for specifying parameters."
- name = "error"
description = "Show this error message if no tag found."
ifDoesntReturnVoid
public void ifDoesntReturnVoid(String template,
Properties attributes)
throws XDocletException
Evaluates the body block if current method doesn't return void.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
ifReturnsVoid(java.lang.String,java.util.Properties)
- type = "block"
- name = "method"
optional = "true"
description = "The method name whose return type is
checked. If not specified then current method is used."
ifDoesntThrowException
public void ifDoesntThrowException(String template,
Properties attributes)
throws XDocletException
Evaluate the body block if current method doesn't throw the exceptions specified in the exceptions
attribute.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
ifThrowsException(java.lang.String,java.util.Properties)
- type = "block"
- name = "method"
optional = "true"
description = "The method name whose return type is
checked. If not specified then current method is used."
- name = "exceptions"
optional = "false"
description = "The exception name which is checked
for"
ifHasMethod
public void ifHasMethod(String template,
Properties attributes)
throws XDocletException
Evaluate the body if current class has a method with the specified name+parameters. If parameters not specified
then any method with the given name and any set of parameters is considered equal to the given method name and so
the test result is positive and the body is evaluated. This method does not change the current method to the one
specified.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
ifDoesntHaveMethod(java.lang.String,java.util.Properties)
- type = "block"
- name = "name"
optional = "false"
description = "The name of the method we're searching for
its existence in current class."
- name = "parameters"
optional = "true"
description = "We're searching for a method that has
the exact set of parameters specified in parameters param."
- name = "delimiter"
optional = "true"
description = "The parameters param is delimited by
the string specified in delimiter parameter."
ifHasMethodComment
public void ifHasMethodComment(String template)
throws XDocletException
Evaluates the body block if current method has a javadoc comment.
template
- The body of the block tag
XDocletException
- Description of Exception
- type = "block"
ifHasMethodTag
public void ifHasMethodTag(String template,
Properties attributes)
throws XDocletException
Evaluates the body if current method has at least one tag with the specified name.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
- name = "tagName"
optional = "false"
description = "The tag name."
- name = "paramName"
description = "The parameter name. If not specified, then the raw
content of the tag is returned."
- name = "paramNum"
description = "The zero-based parameter number. It's used if the user
used the space-separated format for specifying parameters."
- name = "error"
description = "Show this error message if no tag found."
ifIsAbstract
public void ifIsAbstract(String template,
Properties attributes)
throws XDocletException
Evaluate the body block if current method is abstract.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
ifIsNotAbstract(java.lang.String,java.util.Properties)
- type = "block"
- name = "method"
optional = "true"
description = "The method name of which abstractness is
evaluated. If not specified then current method is used."
ifIsGetter
public void ifIsGetter(String template,
Properties attributes)
throws XDocletException
Evaluates the body if the specified method (or current method if none is supplied) is a getter method.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
- name = "method"
optional = "true"
description = "The method name."
ifIsNotAbstract
public void ifIsNotAbstract(String template,
Properties attributes)
throws XDocletException
Evaluates the body block if current method is not abstract.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
ifIsAbstract(java.lang.String,java.util.Properties)
- type = "block"
- name = "method"
optional = "true"
description = "The method name of which exceptions list
is extracted. If not specified then current method is used."
ifIsNotOfType
public void ifIsNotOfType(String template,
Properties attributes)
throws XDocletException
Evaluates the body if the return type of the current method doesn't equal the specified value.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
- name = "type"
optional = "false"
description = "The type to compare."
ifIsOfType
public void ifIsOfType(String template,
Properties attributes)
throws XDocletException
Evaluates the body if the return type of the current method equals the specified value.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
- name = "type"
optional = "false"
description = "The type to compare."
ifIsOfTypeImpl
public boolean ifIsOfTypeImpl(String template,
Properties attributes)
throws XDocletException
ifIsPublic
public void ifIsPublic(String template)
throws XDocletException
Evaluates the body if the current method has public visibility.
template
- The body of the block tag
XDocletException
- Description of Exception
- type = "block"
ifIsSetter
public void ifIsSetter(String template,
Properties attributes)
throws XDocletException
Evaluates the body if the specified method (or current method if none is supplied) is a setter method.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
- name = "method"
optional = "true"
description = "The method name."
ifMethodNameEquals
public void ifMethodNameEquals(String template,
Properties attributes)
throws XDocletException
Evaluates the body if method name equals to the specified value.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
- name = "name"
optional = "false"
description = "The method name."
ifMethodNameNotEquals
public void ifMethodNameNotEquals(String template,
Properties attributes)
throws XDocletException
Evaluates the body if method name equals to the specified value.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
- name = "name"
optional = "false"
description = "The method name."
ifMethodTagValueEquals
public void ifMethodTagValueEquals(String template,
Properties attributes)
throws XDocletException
Evaluates the body if value for the method tag equals the specified value.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
- name = "tagName"
optional = "false"
description = "The tag name."
- name = "paramName"
description = "The parameter name. If not specified, then the raw
content of the tag is returned."
- name = "paramNum"
description = "The zero-based parameter number. It's used if the user
used the space-separated format for specifying parameters."
ifMethodTagValueNotEquals
public void ifMethodTagValueNotEquals(String template,
Properties attributes)
throws XDocletException
Evaluates the body if value for the method tag not equals the specified value.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
- type = "block"
- name = "tagName"
optional = "false"
description = "The tag name."
- name = "paramName"
description = "The parameter name. If not specified, then the raw
content of the tag is returned."
- name = "paramNum"
description = "The zero-based parameter number. It's used if the user
used the space-separated format for specifying parameters."
ifReturnsVoid
public void ifReturnsVoid(String template,
Properties attributes)
throws XDocletException
Evaluate the body block if current method returns void.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
ifDoesntReturnVoid(java.lang.String,java.util.Properties)
- type = "block"
- name = "method"
optional = "true"
description = "The method name whose return type is
checked. If not specified then current method is used."
ifThrowsException
public void ifThrowsException(String template,
Properties attributes)
throws XDocletException
Evaluate the body block if current method throws the exceptions specified in the exceptions
attribute.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
ifDoesntThrowException(java.lang.String,java.util.Properties)
- type = "block"
- name = "method"
optional = "true"
description = "The method name whose return type is
checked. If not specified then current method is used."
- name = "exceptions"
optional = "false"
description = "The exception name which is checked
for"
isGetter
public static boolean isGetter(String str)
Returns true if the str string starts with a getter prefix ("get" or "is").
str
- Description of Parameter
- The Getter value
isGetterMethod
public static boolean isGetterMethod(XMethod method)
isSetter
public static boolean isSetter(String str)
Returns true if the str string starts with "set" prefix.
str
-
isSetterMethod
public static boolean isSetterMethod(XMethod method)
methodComment
public String methodComment(Properties attributes)
throws XDocletException
The comment for the current method.
attributes
- The attributes of the template tag
- comment
XDocletException
- Description of Exception
ClassTagsHandler.classComment(java.util.Properties)
- type = "content"
- name = "no-comment-signs"
optional = "true"
values = "true,false"
description = "If true
then don't decorate the comment with comment signs."
methodName
public String methodName(Properties attributes)
throws XDocletException
Returns the name of the current method.
attributes
- The attributes of the template tag
- Description of the Returned Value
XDocletException
- Description of Exception
- type = "content"
methodNameWithoutPrefix
public String methodNameWithoutPrefix()
throws XDocletException
Returns the name of the current method without the first three characters. Used for cases where the method name
without the get/set prefix is needed.
- Description of the Returned Value
XDocletException
- Description of Exception
- type = "content"
methodTagValue
public String methodTagValue(Properties attributes)
throws XDocletException
Iterates over all method tags with the specified tagName for the current method probably inside of a
forAllMethodTags body.
attributes
- The attributes of the template tag
- Description of the Returned Value
XDocletException
- Description of Exception
- type = "content"
- name = "tagName"
optional = "false"
description = "The tag name."
- name = "paramName"
description = "The parameter name. If not specified, then the raw
content of the tag is returned."
- name = "paramNum"
description = "The zero-based parameter number. It's used if the user
used the space-separated format for specifying parameters."
- name = "values"
description = "The valid values for the parameter, comma separated. An
error message is printed if the parameter value is not one of the values."
- name = "default"
description = "The default value is returned if parameter not specified
by user for the tag."
methodType
public String methodType(Properties attributes)
throws XDocletException
Returns the return type of the current method.
attributes
- The attributes of the template tag
- return type
XDocletException
- Description of Exception
- type = "content"
modifiers
public String modifiers()
throws XDocletException
Any modifiers (static, volatile, etc.) for the current method.
- modifiers
XDocletException
- Describe the exception
- type = "content"
propertyName
public String propertyName()
throws XDocletException
Returns the property name extracted from the current method name. Remove any getter/setter prefix from method
name and decapitalize it.
- property name
XDocletException
- Description of Exception
- type = "content"
setCurrentMethod
public void setCurrentMethod(String template,
Properties attributes)
throws XDocletException
Evaluate the body if current class has a method with the specified name+parameters. If parameters not specified
then any method with the given name and any set of parameters is considered equal to the given method name and so
the test result is positive and the body is evaluated. This method change the current method to the one
specified.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exception
ifHasMethod(java.lang.String,java.util.Properties)
- type = "block"
- name = "name"
optional = "false"
description = "The name of the method we're searching for
its existence in current class."
- name = "parameters"
optional = "true"
description = "We're searching for a method that has
the exact set of parameters specified in parameters param."
- name = "delimiter"
optional = "true"
description = "The parameters param is delimited by
the string specified in delimiter parameter."
setterMethod
public String setterMethod()
throws XDocletException
Returns the setter method name for the current method by prefixing the method name with a 'set' and removing the
getter method's 'get' or 'is' prefixes, if any.
- Description of the Returned Value
XDocletException
- Description of Exception
methodNameWithoutPrefix()
, getterMethod()
- type = "content"
transformedMethodType
public String transformedMethodType(Properties attributes)
throws XDocletException
Returns the transformed return type of the current method.
attributes
-
- Description of the Returned Value
XDocletException
- Description of Exception
- type = "content"