xdoclet.tagshandler
Class PropertyTagsHandler

java.lang.Object
  extended by xdoclet.template.TemplateTagHandler
      extended by xdoclet.XDocletTagSupport
          extended by xdoclet.tagshandler.AbstractProgramElementTagsHandler
              extended by xdoclet.tagshandler.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
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
 
Constructor Summary
PropertyTagsHandler()
           
 
Method Summary
 void forAllPropertiesWithTag(java.lang.String template, java.util.Properties attributes)
          Evaluates the body block for each property of current mbean.
static xjavadoc.XMethod getXMethodForMethodName(java.lang.String methodName)
          Searches for the XMethod of the method with name methodName and returns it.
static xjavadoc.XMethod getXMethodForMethodName(java.lang.String methodName, boolean superclasses)
          Searches for the XMethod of the method with name methodName and returns it.
 void ifHasGetMethodWithTag(java.lang.String template, java.util.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(java.lang.String template, java.util.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(java.lang.String template, java.util.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.
 java.lang.String paramValueWithTag(java.util.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.
 java.lang.String propertyTypeWithTag(java.util.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, forAllMembers, forAllMemberTags, forAllMemberTagTokens, getAllClasses, getClassNameFor, getFullClassNameFor, getFullSuperclassNameFor, getIndentChars, getXExecutableMemberForMemberName, getXExecutableMemberForMemberName, hasExecutableMember_OLD, hasExecutableMember, 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, hasHavingClassTag, hasTag, isTagValueEqual, mandatoryParamNotFound, mandatoryTemplateTagParamNotFound, modifiers, popCurrentClass, pushCurrentClass, setCurrentClass, setCurrentClassTag, setCurrentConstructor, setCurrentField, setCurrentFieldTag, setCurrentMethod, setCurrentMethodTag, setCurrentPackage
 
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

PropertyTagsHandler

public PropertyTagsHandler()
Method Detail

getXMethodForMethodName

public static xjavadoc.XMethod getXMethodForMethodName(java.lang.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 xjavadoc.XMethod getXMethodForMethodName(java.lang.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

forAllPropertiesWithTag

public void forAllPropertiesWithTag(java.lang.String template,
                                    java.util.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 - The attributes of the template tag
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."
To do:
i18n

ifHasGetMethodWithTag

public void ifHasGetMethodWithTag(java.lang.String template,
                                  java.util.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 - The body of the block tag
attributes - The attributes of the template tag
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."

ifHasSetMethodWithTag

public void ifHasSetMethodWithTag(java.lang.String template,
                                  java.util.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 - The body of the block tag
attributes - The attributes of the template tag
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."

propertyTypeWithTag

public java.lang.String propertyTypeWithTag(java.util.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."
To do:
i18n

paramValueWithTag

public java.lang.String paramValueWithTag(java.util.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.

ifHasParamWithTag

public void ifHasParamWithTag(java.lang.String template,
                              java.util.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 - The body of the block tag
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."

http://xdoclet.sourceforge.net/