xdoclet.tags
Class AbstractProgramElementTagsHandler

java.lang.Object
  |
  +--xdoclet.template.TemplateTagHandler
        |
        +--xdoclet.XDocletTagSupport
              |
              +--xdoclet.tags.AbstractProgramElementTagsHandler
Direct Known Subclasses:
ClassTagsHandler, ConstructorTagsHandler, FieldTagsHandler, JMXTagsHandler, MethodTagsHandler, PackageTagsHandler, ParameterTagsHandler, PropertyTagsHandler

public abstract class AbstractProgramElementTagsHandler
extends XDocletTagSupport

Version:
$Revision: 1.23 $
Author:
Ara Abrahamian (ara_e@email.com)

Field Summary
protected static java.lang.String currentToken
          The current token.
protected static java.lang.String matchPattern
          Template can use matchPattern as a place where they can put volatile variable.
protected static java.util.StringTokenizer tagTokenizer
          The StringTokenizer object doing the tokenization.
 
Fields inherited from class xdoclet.XDocletTagSupport
FOR_CLASS, FOR_CONSTRUCTOR, FOR_FIELD, FOR_METHOD, PARAMETER_DELIMITER
 
Constructor Summary
AbstractProgramElementTagsHandler()
           
 
Method Summary
protected  java.lang.String checkForWrap(java.lang.String pText)
          A utility method used by firstSentenceDescription to replace end of line by space.
 java.lang.String currentToken(java.util.Properties attributes)
          Returns current token inside forAllClassTagTokens.
protected  java.lang.String exceptionList(java.util.Properties attributes, int for_type)
           
protected  void forAllMembers(java.lang.String template, java.util.Properties attributes, int for_type)
           
protected  void forAllMemberTags(java.lang.String template, java.util.Properties attributes, int for_type, java.lang.String resourceKey, java.lang.String[] arguments)
           
protected  void forAllMemberTagTokens(java.lang.String template, java.util.Properties attributes, int for_type)
           
static com.sun.javadoc.ClassDoc[] getAllClasses()
          Utility method to get classes for iteration used by various methods.
static java.lang.String getClassNameFor(com.sun.javadoc.ClassDoc clazz)
          Returns the not-full-qualified name of the current class without the package name.
protected  com.sun.javadoc.ExecutableMemberDoc getExecutableMemberDocForMemberName(java.lang.String memberName, boolean superclasses, int for_type)
          Searches for the ExecutableMemberDoc of the member with name methodName and returns it.
protected  com.sun.javadoc.ExecutableMemberDoc getExecutableMemberDocForMemberName(java.lang.String memberName, int for_type)
           
static java.lang.String getFullClassNameFor(com.sun.javadoc.ClassDoc clazz)
          Returns the full-qualified name of the current class with the package name.
static java.lang.String getFullSuperclassNameFor(com.sun.javadoc.ClassDoc clazz)
          Returns the full-qualified name of the superclass of the current class.
protected  char[] getIndentChars(java.util.Properties attributes)
          A utility method to get the blank space characters used for indenting comments.
protected static boolean hasExecutableMember(com.sun.javadoc.ClassDoc clazz, java.lang.String executableMemberName, java.lang.String[] parameters, boolean setCurrentExecutableMember, int for_type)
           
protected  boolean ifHasTag_Impl(java.lang.String template, java.util.Properties attributes, int for_type)
          A utility method used by ifHasClassTag/ifDoesntHaveClassTag and ifHasMethodTag/ifDoesntHaveMethodTag, return true if at least one tag exists with the specified name.
 boolean ifTagValueEquals_Impl(java.lang.String template, java.util.Properties attributes, int FOR_TYPE)
          A utility method used by ifMethodTagValueEquals/ifMethodTagValueNotEquals and ifClassTagValueEquals/ifClassTagValueNotEquals, return true if the value of the tag/parameter equals with value.
 java.lang.String matchValue()
          Returns the value of match variable.
protected  java.lang.String memberComment(java.util.Properties attributes, int for_type)
           
 void setMatchValue(java.lang.String template, java.util.Properties attributes)
          Sets the value of match variable.
 java.lang.String skipToken(java.util.Properties attributes)
          Skips current token.
 
Methods inherited from class xdoclet.XDocletTagSupport
getClassTagValue, getClassTagValue, getConstructorTagValue, getCurrentClass, getCurrentConstructor, getCurrentField, getCurrentMethod, getCurrentPackage, getCurrentTag, getDocletContext, getFieldTagValue, getFieldTagValue, getMethodTagValue, getMethodTagValue, getParameterValue, getParameterValue, getTagValue, getTagValue, getTagValue, invalidParamValueFound, mandatoryParamNotFound, mandatoryTemplateTagParamNotFound, parsePropertyString, popCurrentClass, pushCurrentClass, replaceProperties, setCurrentClass, setCurrentConstructor, setCurrentField, setCurrentMethod, setCurrentPackage, setCurrentTag, tokenizeValue
 
Methods inherited from class xdoclet.template.TemplateTagHandler
generate, getContext, getEngine, getParser, setContext, setEngine, setParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentToken

protected static java.lang.String currentToken
The current token. Currently forAllParameterTypes and forAllClassTagTokens set it and currentToken returns the value. Tokens are computed for cases where the value should be tokenized by a set of delimiters.

tagTokenizer

protected static java.util.StringTokenizer tagTokenizer
The StringTokenizer object doing the tokenization. It should be shared by different tag implementations, that's why its defined class-level.

matchPattern

protected static java.lang.String matchPattern
Template can use matchPattern as a place where they can put volatile variable. You can set the value somewhere in the template and later use the value.
Constructor Detail

AbstractProgramElementTagsHandler

public AbstractProgramElementTagsHandler()
Method Detail

getClassNameFor

public static java.lang.String getClassNameFor(com.sun.javadoc.ClassDoc clazz)
Returns the not-full-qualified name of the current class without the package name.
Parameters:
clazz - Description of Parameter
Returns:
Description of the Returned Value

getFullClassNameFor

public static java.lang.String getFullClassNameFor(com.sun.javadoc.ClassDoc clazz)
Returns the full-qualified name of the current class with the package name.
Parameters:
clazz - Description of Parameter
Returns:
Description of the Returned Value

getFullSuperclassNameFor

public static java.lang.String getFullSuperclassNameFor(com.sun.javadoc.ClassDoc clazz)
Returns the full-qualified name of the superclass of the current class.
Parameters:
clazz - Description of Parameter
Returns:
Description of the Returned Value

getAllClasses

public static com.sun.javadoc.ClassDoc[] getAllClasses()
Utility method to get classes for iteration used by various methods. The result depends on the context: are we within a forAllPackages iteration or not.
Returns:
An array with all classes in that context in it.

hasExecutableMember

protected static boolean hasExecutableMember(com.sun.javadoc.ClassDoc clazz,
                                             java.lang.String executableMemberName,
                                             java.lang.String[] parameters,
                                             boolean setCurrentExecutableMember,
                                             int for_type)
                                      throws XDocletException

setMatchValue

public void setMatchValue(java.lang.String template,
                          java.util.Properties attributes)
                   throws XDocletException
Sets the value of match variable.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - Description of Exception

ifTagValueEquals_Impl

public boolean ifTagValueEquals_Impl(java.lang.String template,
                                     java.util.Properties attributes,
                                     int FOR_TYPE)
                              throws XDocletException
A utility method used by ifMethodTagValueEquals/ifMethodTagValueNotEquals and ifClassTagValueEquals/ifClassTagValueNotEquals, return true if the value of the tag/parameter equals with value.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
FOR_TYPE -  
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

matchValue

public java.lang.String matchValue()
                            throws XDocletException
Returns the value of match variable. Match variable serves as a variable for templates, you set it somewhere in template and look it up somewhere else in template.
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

currentToken

public java.lang.String currentToken(java.util.Properties attributes)
                              throws XDocletException
Returns current token inside forAllClassTagTokens.
Parameters:
attributes - The attributes of the template tag
Returns:
value of currently processed token
Throws:
XDocletException - Description of Exception

skipToken

public java.lang.String skipToken(java.util.Properties attributes)
                           throws XDocletException
Skips current token. Returns empty string.
Parameters:
attributes - The attributes of the template tag
Returns:
Empty string
Throws:
XDocletException - Description of Exception

getExecutableMemberDocForMemberName

protected com.sun.javadoc.ExecutableMemberDoc getExecutableMemberDocForMemberName(java.lang.String memberName,
                                                                                  int for_type)
                                                                           throws XDocletException

getExecutableMemberDocForMemberName

protected com.sun.javadoc.ExecutableMemberDoc getExecutableMemberDocForMemberName(java.lang.String memberName,
                                                                                  boolean superclasses,
                                                                                  int for_type)
                                                                           throws XDocletException
Searches for the ExecutableMemberDoc of the member with name methodName and returns it.
Parameters:
superclasses - Search superclasses.
memberName -  
for_type -  
Returns:
The MethodDoc for the method named value
Throws:
XDocletException -  

getIndentChars

protected char[] getIndentChars(java.util.Properties attributes)
A utility method to get the blank space characters used for indenting comments.
Parameters:
attributes - The attributes of the template tag
Returns:
The IndentChars value
See Also:
MethodTagsHandler.methodComment(java.util.Properties), ClassTagsHandler.classComment(java.util.Properties)

exceptionList

protected java.lang.String exceptionList(java.util.Properties attributes,
                                         int for_type)
                                  throws XDocletException

forAllMemberTagTokens

protected void forAllMemberTagTokens(java.lang.String template,
                                     java.util.Properties attributes,
                                     int for_type)
                              throws XDocletException

forAllMemberTags

protected void forAllMemberTags(java.lang.String template,
                                java.util.Properties attributes,
                                int for_type,
                                java.lang.String resourceKey,
                                java.lang.String[] arguments)
                         throws XDocletException

memberComment

protected java.lang.String memberComment(java.util.Properties attributes,
                                         int for_type)
                                  throws XDocletException

forAllMembers

protected void forAllMembers(java.lang.String template,
                             java.util.Properties attributes,
                             int for_type)
                      throws XDocletException

ifHasTag_Impl

protected boolean ifHasTag_Impl(java.lang.String template,
                                java.util.Properties attributes,
                                int for_type)
                         throws XDocletException
A utility method used by ifHasClassTag/ifDoesntHaveClassTag and ifHasMethodTag/ifDoesntHaveMethodTag, return true if at least one tag exists with the specified name.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
for_type -  
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

checkForWrap

protected java.lang.String checkForWrap(java.lang.String pText)
A utility method used by firstSentenceDescription to replace end of line by space.
Parameters:
pText - Description of Parameter
Returns:
Description of the Returned Value