xdoclet.tagshandler

Class PropertyTagsHandler


public class PropertyTagsHandler
extends AbstractProgramElementTagsHandler

PropertyTagsHandler.java

Version:
$Revision: 1.12 $

Author:
David Jencks

xdoclet.taghandler
namespace = "Property"

created
Wed Feb 27 21:53:15 2002

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

Method Summary

void
forAllPropertiesWithTag(String template, Properties attributes)
Evaluates the body block for each property of current mbean.You may set whether superclasses are examined also with the superclass attribute.
static XMethod
getXMethodForMethodName(String methodName)
Searches for the XMethod of the method with name methodName and returns it.
static XMethod
getXMethodForMethodName(String methodName, boolean superclasses)
void
ifHasGetMethodWithTag(String template, Properties attributes)
The block tag ifHasGetMethodWithTag looks for a get method based on the attribute name from the current method, sets the current method to that get method, and applies the template if found.
void
ifHasParamWithTag(String template, Properties attributes)
Determines if there is a get or set method with the required tag for the current property that also has the requested parameter.
void
ifHasSetMethodWithTag(String template, Properties attributes)
The block tag ifHasSetMethodWithTag looks for a set method based on the attribute name from the current method, sets the current method to that set method, and applies the template if found.
String
paramValueWithTag(Properties attributes)
Looks for a get or set method with the required tag for the current property that also has the requested parameter, and returns the value of the requested parameter if present.
String
propertyTypeWithTag(Properties attributes)
The propertyTypeWithTag method figures out the type for the current property with tag by looking for a getter, then a setter.

Methods inherited from class xdoclet.tagshandler.AbstractProgramElementTagsHandler

checkForWrap, currentToken, exceptionList, firstSentenceDescriptionOfCurrentMember, forAllMemberTagTokens, forAllMemberTags, forAllMembers, getAllClasses, getClassNameFor, getFullClassNameFor, getFullSuperclassNameFor, getIndentChars, getXExecutableMemberForMemberName, getXExecutableMemberForMemberName, hasExecutableMember, hasExecutableMember_OLD, makeCopyOfArray, matchValue, memberComment, setMatchValue, skipToken

Methods inherited from class xdoclet.XDocletTagSupport

delimit, expandClassName, generate, getCurrentClass, getCurrentClassTag, getCurrentConstructor, getCurrentField, getCurrentFieldTag, getCurrentMethod, getCurrentMethodTag, getCurrentPackage, getDocletContext, getEngine, getExpandedDelimitedTagValue, getTagValue, getTagValue, getTagValue, hasTag, isTagValueEqual, mandatoryParamNotFound, mandatoryTemplateTagParamNotFound, modifiers, popCurrentClass, pushCurrentClass, setCurrentClass, setCurrentClassTag, setCurrentConstructor, setCurrentField, setCurrentFieldTag, setCurrentMethod, setCurrentMethodTag, setCurrentPackage

Methods inherited from class xdoclet.template.TemplateTagHandler

getXJavaDoc, setXJavaDoc

Method Details

forAllPropertiesWithTag

public void forAllPropertiesWithTag(String template,
                                    Properties attributes)
            throws XDocletException
Evaluates the body block for each property of current mbean.You may set whether superclasses are examined also with the superclass attribute. Finds properties with getter, setter, or both. The getter and setter should have javabean naming convention. Only methods with the supplied tag are considered in looking for properties.

Parameters:
template - The body of the block tag
attributes -

Throws:
XDocletException - Description of Exception

doc.tag
type = "block"

doc.param
name = "superclasses" optional = "true" values = "true,false" description = "Include properties of superclasses. True by default."
name = "tagName" optional = "false" description = "The required tag for methods to be considered a getter or setter. For example, jmx:managed-attribute."


getXMethodForMethodName

public static XMethod getXMethodForMethodName(String methodName)
Searches for the XMethod of the method with name methodName and returns it. Copied from MethodTagsHandler

Parameters:
methodName - Description of Parameter

Returns:
The XMethodForMethodName value or null if not found


getXMethodForMethodName

public static XMethod getXMethodForMethodName(String methodName,
                                              boolean superclasses)


ifHasGetMethodWithTag

public void ifHasGetMethodWithTag(String template,
                                  Properties attributes)
            throws XDocletException
The block tag ifHasGetMethodWithTag looks for a get method based on the attribute name from the current method, sets the current method to that get method, and applies the template if found. This is used to look for getters for mbean managed attributes. The get method found may be the current method.

Parameters:
template - a String value
attributes - a Properties value

Throws:
XDocletException - if an error occurs

doc.tag
type = "block"

doc.param
name = "tagName" optional = "false" description = "The required tag for methods to be considered a getter or setter. For example, jmx:managed-attribute."


ifHasParamWithTag

public void ifHasParamWithTag(String template,
                              Properties attributes)
            throws XDocletException
Determines if there is a get or set method with the required tag for the current property that also has the requested parameter.

Parameters:
template -
attributes - The attributes of the template tag

Throws:
XDocletException - Description of Exception

doc.tag
type = "block"

doc.param
name = "tagName" optional = "false" description = "The tag name required for a getter or setter to belong to a property."
name = "paramName" description = "The parameter name. Required for property parameter values. content of the tag is returned."


ifHasSetMethodWithTag

public void ifHasSetMethodWithTag(String template,
                                  Properties attributes)
            throws XDocletException
The block tag ifHasSetMethodWithTag looks for a set method based on the attribute name from the current method, sets the current method to that set method, and applies the template if found. This is used to look for setters for mbean managed attributes. The set method found may be the current method.

Parameters:
template - a String value
attributes - a Properties value

Throws:
XDocletException - if an error occurs

doc.tag
type = "block"

doc.param
name = "tagName" optional = "false" description = "The required tag for methods to be considered a getter or setter. For example, jmx:managed-attribute."


paramValueWithTag

public String paramValueWithTag(Properties attributes)
            throws XDocletException
Looks for a get or set method with the required tag for the current property that also has the requested parameter, and returns the value of the requested parameter if present.

Parameters:
attributes - The attributes of the template tag

Returns:
Description of the Returned Value

Throws:
XDocletException - Description of Exception

doc.tag
type = "content"

doc.param
name = "tagName" optional = "false" description = "The tag name required for a getter or setter to belong to a property."
name = "paramName" description = "The parameter name. Required for property parameter values. content of the tag is returned."
name = "default" description = "The default value is returned if there is no value for the parameter requested.


propertyTypeWithTag

public String propertyTypeWithTag(Properties attributes)
            throws XDocletException
The propertyTypeWithTag method figures out the type for the current property with tag by looking for a getter, then a setter.

Parameters:
attributes - a Properties value including the tagName required.

Returns:
the String fully qualified name of the property type.

Throws:
XDocletException - if an error occurs

doc.tag
type = "content"

doc.param
name = "tagName" optional = "false" description = "The required tag for methods to be considered a getter or setter. For example, jmx:managed-attribute."