|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectxdoclet.template.TemplateTagHandler
xdoclet.XDocletTagSupport
xdoclet.tagshandler.AbstractProgramElementTagsHandler
xdoclet.tagshandler.MethodTagsHandler
public class MethodTagsHandler
Field Summary |
---|
Fields inherited from class xdoclet.tagshandler.AbstractProgramElementTagsHandler |
---|
currentToken, matchPattern, tagTokenizer |
Fields inherited from class xdoclet.XDocletTagSupport |
---|
FOR_CLASS, FOR_CONSTRUCTOR, FOR_FIELD, FOR_METHOD, PARAMETER_DELIMITER |
Constructor Summary | |
---|---|
MethodTagsHandler()
|
Method Summary | |
---|---|
java.lang.String |
currentMethodName()
Returns the current method name. |
java.lang.String |
exceptionList(java.util.Properties attributes)
Iterates over all exceptions thrown by the current or specified method and returns a string containing definition of all those exceptions. |
void |
executeAndRestoreMethod(java.lang.String template,
java.util.Properties attributes)
Evaluate the current block, and then restore the current method before continuing. |
java.lang.String |
firstSentenceDescriptionOfCurrentMethod()
Return standard javadoc of current method. |
void |
forAllClassMethods(java.lang.String template,
java.util.Properties attributes)
Loops through all methods for all classes after first sorting all the methods. |
void |
forAllMethods(java.lang.String template,
java.util.Properties attributes)
Iterates over all methods of current class and evaluates the body of the tag for each method. |
void |
forAllMethodTags(java.lang.String template,
java.util.Properties attributes)
Iterates over all tags of current method and evaluates the body of the tag for each method. |
void |
forAllMethodTagTokens(java.lang.String template,
java.util.Properties attributes)
Iterates over all tokens in current method tag with the name tagName and evaluates the body for every token. |
static java.lang.String |
getMethodNameWithoutPrefixFor(xjavadoc.XMethod currentMethod)
Merge with modified SubTask.methodNameWithoutPrefix |
static java.lang.String |
getMethodTypeFor(xjavadoc.XMethod method)
|
static java.lang.String |
getPropertyNameFor(xjavadoc.XMethod method)
Gets the PropertyNameFor attribute of the MethodTagsHandler class |
java.lang.String |
getterMethod()
Returns the getter method name for the current method by prefixing the method name with the proper getter prefix. |
java.lang.String |
getterPrefix()
Returns 'get' or 'is' getter prefix part of the current method. |
static java.lang.String |
getTransformedMethodTypeFor(xjavadoc.XMethod method)
|
static boolean |
hasMethod(xjavadoc.XClass clazz,
java.lang.String methodName,
java.lang.String[] parameters,
boolean setCurrentMethod)
Returns true if a method with the specified methodName+parameters is found in the class clazz. |
void |
ifDoesntHaveMethod(java.lang.String template,
java.util.Properties attributes)
Evaluate the body if current class doesn't have a method with the specified name+parameters. |
void |
ifDoesntHaveMethodTag(java.lang.String template,
java.util.Properties attributes)
Evaluates the body if current method doesn't have at least one tag with the specified name. |
void |
ifDoesntReturnVoid(java.lang.String template,
java.util.Properties attributes)
Evaluates the body block if current method doesn't return void. |
void |
ifDoesntThrowException(java.lang.String template,
java.util.Properties attributes)
Evaluate the body block if current method doesn't throw the exceptions specified in the exceptions
attribute. |
void |
ifHasMethod(java.lang.String template,
java.util.Properties attributes)
Evaluate the body if current class has a method with the specified name+parameters. |
void |
ifHasMethodComment(java.lang.String template)
Evaluates the body block if current method has a javadoc comment. |
void |
ifHasMethodTag(java.lang.String template,
java.util.Properties attributes)
Evaluates the body if current method has at least one tag with the specified name. |
void |
ifIsAbstract(java.lang.String template,
java.util.Properties attributes)
Evaluate the body block if current method is abstract. |
void |
ifIsGetter(java.lang.String template,
java.util.Properties attributes)
Evaluates the body if the specified method (or current method if none is supplied) is a getter method. |
void |
ifIsNotAbstract(java.lang.String template,
java.util.Properties attributes)
Evaluates the body block if current method is not abstract. |
void |
ifIsNotOfType(java.lang.String template,
java.util.Properties attributes)
Evaluates the body if the return type of the current method doesn't equal the specified value. |
void |
ifIsOfType(java.lang.String template,
java.util.Properties attributes)
Evaluates the body if the return type of the current method equals the specified value. |
boolean |
ifIsOfTypeImpl(java.lang.String template,
java.util.Properties attributes)
|
void |
ifIsPublic(java.lang.String template)
Evaluates the body if the current method has public visibility. |
void |
ifIsSetter(java.lang.String template,
java.util.Properties attributes)
Evaluates the body if the specified method (or current method if none is supplied) is a setter method. |
void |
ifMethodNameEquals(java.lang.String template,
java.util.Properties attributes)
Evaluates the body if method name equals to the specified value. |
void |
ifMethodNameNotEquals(java.lang.String template,
java.util.Properties attributes)
Evaluates the body if method name equals to the specified value. |
void |
ifMethodTagValueEquals(java.lang.String template,
java.util.Properties attributes)
Evaluates the body if value for the method tag equals the specified value. |
void |
ifMethodTagValueNotEquals(java.lang.String template,
java.util.Properties attributes)
Evaluates the body if value for the method tag not equals the specified value. |
void |
ifReturnsVoid(java.lang.String template,
java.util.Properties attributes)
Evaluate the body block if current method returns void. |
void |
ifThrowsException(java.lang.String template,
java.util.Properties attributes)
Evaluate the body block if current method throws the exceptions specified in the exceptions
attribute. |
static boolean |
isGetter(java.lang.String str)
Returns true if the str string starts with a getter prefix ("get" or "is"). |
static boolean |
isGetterMethod(xjavadoc.XMethod method)
|
static boolean |
isSetter(java.lang.String str)
Returns true if the str string starts with "set" prefix. |
static boolean |
isSetterMethod(xjavadoc.XMethod method)
|
java.lang.String |
methodComment(java.util.Properties attributes)
The comment for the current method. |
java.lang.String |
methodName(java.util.Properties attributes)
Returns the name of the current method. |
java.lang.String |
methodNameWithoutPrefix()
Returns the name of the current method without the first three characters. |
java.lang.String |
methodTagValue(java.util.Properties attributes)
Iterates over all method tags with the specified tagName for the current method probably inside of a forAllMethodTags body. |
java.lang.String |
methodType(java.util.Properties attributes)
Returns the return type of the current method. |
java.lang.String |
modifiers()
Any modifiers (static, volatile, etc.) for the current method. |
java.lang.String |
propertyName()
Returns the property name extracted from the current method name. |
void |
setCurrentMethod(java.lang.String template,
java.util.Properties attributes)
Evaluate the body if current class has a method with the specified name+parameters. |
java.lang.String |
setterMethod()
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. |
java.lang.String |
transformedMethodType(java.util.Properties attributes)
Returns the transformed return type of the current method. |
Methods inherited from class xdoclet.template.TemplateTagHandler |
---|
getXJavaDoc, setXJavaDoc |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MethodTagsHandler()
Method Detail |
---|
public static java.lang.String getMethodTypeFor(xjavadoc.XMethod method)
public static java.lang.String getTransformedMethodTypeFor(xjavadoc.XMethod method)
public static java.lang.String getMethodNameWithoutPrefixFor(xjavadoc.XMethod currentMethod)
currentMethod
- Description of Parameter
public static java.lang.String getPropertyNameFor(xjavadoc.XMethod method)
method
- Describe what the parameter does
public static boolean isGetter(java.lang.String str)
str
- Description of Parameter
public static boolean isSetter(java.lang.String str)
str
-
public static boolean isGetterMethod(xjavadoc.XMethod method)
public static boolean isSetterMethod(xjavadoc.XMethod method)
public static boolean hasMethod(xjavadoc.XClass clazz, java.lang.String methodName, java.lang.String[] parameters, boolean setCurrentMethod) throws XDocletException
clazz
- Description of ParametermethodName
- Description of Parameterparameters
- Description of ParametersetCurrentMethod
-
XDocletException
public java.lang.String getterPrefix() throws XDocletException
XDocletException
- Description of Exceptionpublic java.lang.String getterMethod() throws XDocletException
XDocletException
- Description of ExceptionmethodNameWithoutPrefix()
,
setterMethod()
,
getterPrefix()
public java.lang.String setterMethod() throws XDocletException
XDocletException
- Description of ExceptionmethodNameWithoutPrefix()
,
getterMethod()
public void setCurrentMethod(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of ExceptionifHasMethod(java.lang.String,java.util.Properties)
public java.lang.String modifiers() throws XDocletException
XDocletException
- Describe the exceptionpublic java.lang.String methodComment(java.util.Properties attributes) throws XDocletException
attributes
- The attributes of the template tag
XDocletException
- Description of ExceptionClassTagsHandler.classComment(java.util.Properties)
public void ifHasMethodComment(java.lang.String template) throws XDocletException
template
- The body of the block tag
XDocletException
- Description of Exceptionpublic java.lang.String exceptionList(java.util.Properties attributes) throws XDocletException
attributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic void ifIsAbstract(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of ExceptionifIsNotAbstract(java.lang.String,java.util.Properties)
public void ifIsNotAbstract(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of ExceptionifIsAbstract(java.lang.String,java.util.Properties)
public void ifReturnsVoid(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of ExceptionifDoesntReturnVoid(java.lang.String,java.util.Properties)
public void ifDoesntReturnVoid(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of ExceptionifReturnsVoid(java.lang.String,java.util.Properties)
public void forAllClassMethods(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic void forAllMethods(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic void ifDoesntHaveMethodTag(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic void ifHasMethodTag(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic void executeAndRestoreMethod(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic void ifMethodTagValueEquals(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic void ifMethodNameEquals(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic void ifMethodNameNotEquals(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic void ifMethodTagValueNotEquals(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic java.lang.String methodTagValue(java.util.Properties attributes) throws XDocletException
attributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic void forAllMethodTags(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic void forAllMethodTagTokens(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic java.lang.String firstSentenceDescriptionOfCurrentMethod() throws XDocletException
XDocletException
- Description of Exceptionpublic java.lang.String methodType(java.util.Properties attributes) throws XDocletException
attributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic java.lang.String transformedMethodType(java.util.Properties attributes) throws XDocletException
attributes
-
XDocletException
- Description of Exceptionpublic void ifIsOfType(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic void ifIsNotOfType(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic boolean ifIsOfTypeImpl(java.lang.String template, java.util.Properties attributes) throws XDocletException
XDocletException
public java.lang.String methodName(java.util.Properties attributes) throws XDocletException
attributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic java.lang.String methodNameWithoutPrefix() throws XDocletException
XDocletException
- Description of Exceptionpublic java.lang.String currentMethodName() throws XDocletException
XDocletException
- Description of Exceptionpublic java.lang.String propertyName() throws XDocletException
XDocletException
- Description of Exceptionpublic void ifHasMethod(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of ExceptionifDoesntHaveMethod(java.lang.String,java.util.Properties)
public void ifDoesntHaveMethod(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of ExceptionifHasMethod(java.lang.String,java.util.Properties)
public void ifIsGetter(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic void ifIsSetter(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of Exceptionpublic void ifIsPublic(java.lang.String template) throws XDocletException
template
- The body of the block tag
XDocletException
- Description of Exceptionpublic void ifThrowsException(java.lang.String template, java.util.Properties attributes) throws XDocletException
exceptions
attribute.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of ExceptionifDoesntThrowException(java.lang.String,java.util.Properties)
public void ifDoesntThrowException(java.lang.String template, java.util.Properties attributes) throws XDocletException
exceptions
attribute.
template
- The body of the block tagattributes
- The attributes of the template tag
XDocletException
- Description of ExceptionifThrowsException(java.lang.String,java.util.Properties)
|
http://xdoclet.sourceforge.net/ | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |