xdoclet.tagshandler

Class PropertyTagsHandler

public class PropertyTagsHandler extends AbstractProgramElementTagsHandler

Tags relating to properties. Properties are identified by javabean-style naming of getters & setters.

Version: $Revision: 1.13 $

Author: David Jencks

UNKNOWN: Wed Feb 27 21:53:15 2002 namespace = "Property"

Method Summary
voidforAllPropertiesWithTag(String template, Properties attributes)
Evaluates the body block for each property of current mbean.
static XMethodgetXMethodForMethodName(String methodName)
Searches for the XMethod of the method with name methodName and returns it.
static XMethodgetXMethodForMethodName(String methodName, boolean superclasses)
Searches for the XMethod of the method with name methodName and returns it.
voidifHasGetMethodWithTag(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.
voidifHasParamWithTag(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.
voidifHasSetMethodWithTag(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.
StringparamValueWithTag(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.
StringpropertyTypeWithTag(Properties attributes)
The propertyTypeWithTag method figures out the type for the current property with tag by looking for a getter, then a setter.

Method Detail

forAllPropertiesWithTag

public 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. 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 The attributes of the template tag

Throws: XDocletException Description of Exception

UNKNOWN: type = "block" 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." i18n

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 The method to search for

Returns: The matching XMethod or null if not found

getXMethodForMethodName

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

Parameters: methodName The method to search for superclasses Whether to also search superclasses

Returns: The matching XMethod or null if not found

ifHasGetMethodWithTag

public 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. This is used to look for getters for mbean managed attributes. The get method found may be the current method.

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

Throws: XDocletException if an error occurs

UNKNOWN: type = "block" 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)
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 The body of the block tag attributes The attributes of the template tag

Throws: XDocletException Description of Exception

UNKNOWN: type = "block" 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)
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 The body of the block tag attributes The attributes of the template tag

Throws: XDocletException if an error occurs

UNKNOWN: type = "block" 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)
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

UNKNOWN: type = "content" 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)
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

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