xdoclet.tagshandler
Class ClassTagsHandler

java.lang.Object
  extended by xdoclet.template.TemplateTagHandler
      extended by xdoclet.XDocletTagSupport
          extended by xdoclet.tagshandler.AbstractProgramElementTagsHandler
              extended by xdoclet.tagshandler.ClassTagsHandler
Direct Known Subclasses:
JBossTagsHandler, JBossWebTagsHandler, JMXTagsHandler, MVCSoftTagsHandler, OpenEJBTagsHandler

public class ClassTagsHandler
extends AbstractProgramElementTagsHandler

Tags relating to classes being processed and class-level attributes.

Version:
$Revision: 1.25 $
Author:
Ara Abrahamian (ara_e_w@yahoo.com)
xdoclet.taghandler
namespace = "Class"
created
Oct 14, 2001

Field Summary
protected static java.text.DateFormat dateFormatter
          Used for setting the timestamp for xdoclet-generated marker in generated files.
protected static java.util.Calendar now
           
 
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
ClassTagsHandler()
           
 
Method Summary
 java.lang.String classComment(java.util.Properties attributes)
          The comment for the current class.
 java.lang.String classCommentTags(java.util.Properties attributes)
          The javadoc comment tags for the current class (plus xdoclet-generated).
 java.lang.String classCommentText(java.util.Properties attributes)
          The text of the javadoc comment for the current class.
 java.lang.String className()
          Returns the not-fully-qualified name of the current class without the package name.
 void classOf(java.lang.String template)
          Returns the not-full-qualified name of the full-qualified class name specified in the body of this tag.
 java.lang.String classTagValue(java.util.Properties attributes)
          Iterates over all class tags with the specified tagName and evaluates the body of the tag for each class tag.
 java.lang.String classTagValueMatch(java.util.Properties attributes)
          Sets the value of match variable.
 java.lang.String firstSentenceDescription(java.util.Properties attributes)
          Return first sentence of standard javadoc of current class.
 void forAllClasses(java.lang.String template, java.util.Properties attributes)
          Iterates over all classes loaded by xjavadoc and evaluates the body of the tag for each class.
 void forAllClassTags(java.lang.String template, java.util.Properties attributes)
          Iterates over all tags of current class with the name tagName and evaluates the body of the tag for each method.
 void forAllClassTagTokens(java.lang.String template, java.util.Properties attributes)
          Iterates over all tokens in specified class tag with the name tagName and evaluates the body for every token.
 void forAllDistinctClassTags(java.lang.String template, java.util.Properties attributes)
          Iterates over all tags named according to tagName in a non-duplicated manner.
static void forAllDistinctClassTags(TemplateEngine engine, java.lang.String template, java.lang.String tagName, java.lang.String paramName)
          Iterates over all tags named according to tagName in a non-duplicated manner.
 java.lang.String fullClassName()
          Returns the full-qualified name of the current class.
 java.lang.String fullSuperclassName()
          Returns the full-qualified name of the superclass of the current class.
 java.lang.String fullTransformedClassName()
          Returns the fully-qualified transformed name of the current class with package name.
static java.lang.String getClassNameFor(xjavadoc.XClass clazz)
          Deprecated. use XClass.name()
static java.lang.String getFullClassNameFor(xjavadoc.XClass clazz)
          Deprecated. use XClass.qualifiedName()
 void ifClassTagValueEquals(java.lang.String template, java.util.Properties attributes)
          Evaluates the body if value for the class tag equals the specified value.
 void ifClassTagValueMatches(java.lang.String template, java.util.Properties attributes)
          Evaluate the body if the match variable equals with the value of the specified tag/parameter.
 void ifClassTagValueNotEquals(java.lang.String template, java.util.Properties attributes)
          Evaluates the body if value for the class tag not equals the specified value.
 void ifDoesntHaveClassTag(java.lang.String template, java.util.Properties attributes)
          Evaluates the body if current class doesn't have at least one tag with the specified name.
 void ifHasClassTag(java.lang.String template, java.util.Properties attributes)
          Evaluates the body if current class has at least one tag with the specified name.
 void ifIsClassAbstract(java.lang.String template)
          Evaluate the body block if current class is abstract.
 void ifIsClassNotAbstract(java.lang.String template)
          Evaluate the body block if current class is not abstract.
 java.lang.String importedList(java.util.Properties attributes)
          Deprecated. Make sure the template file uses full qualified class names everywhere instead.
 java.lang.String modifiers()
          The current class' modifiers.
 void pushClass(java.lang.String template, java.util.Properties attributes)
          Pushes the class specified by value parameter to top of stack making it the current class.
 java.lang.String symbolicClassName()
          Returns the symbolic name of the current class.
 java.lang.String transformedClassName()
          Returns the transformed name of the current class with package name.
 
Methods inherited from class xdoclet.tagshandler.AbstractProgramElementTagsHandler
checkForWrap, currentToken, exceptionList, firstSentenceDescriptionOfCurrentMember, forAllMembers, forAllMemberTags, forAllMemberTagTokens, getAllClasses, 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
 

Field Detail

dateFormatter

protected static final java.text.DateFormat dateFormatter
Used for setting the timestamp for xdoclet-generated marker in generated files.


now

protected static final java.util.Calendar now
Constructor Detail

ClassTagsHandler

public ClassTagsHandler()
Method Detail

getClassNameFor

public static java.lang.String getClassNameFor(xjavadoc.XClass clazz)
Deprecated. use XClass.name()

Returns the not-full-qualified name of the specified class without the package name.

Parameters:
clazz - Description of Parameter
Returns:
Description of the Returned Value
To do:
duplicate in AbstractProgramElementTagsHandler

getFullClassNameFor

public static java.lang.String getFullClassNameFor(xjavadoc.XClass clazz)
Deprecated. use XClass.qualifiedName()

Returns the full-qualified name of the specified class with the package name.

Parameters:
clazz - Description of Parameter
Returns:
Description of the Returned Value

forAllDistinctClassTags

public static void forAllDistinctClassTags(TemplateEngine engine,
                                           java.lang.String template,
                                           java.lang.String tagName,
                                           java.lang.String paramName)
                                    throws XDocletException
Iterates over all tags named according to tagName in a non-duplicated manner. The paramName parameter should be the tag parameter that should be unique during the iteration. Duplicated tags will generate a warning message. Please note that this tag already processes all classes. There is no need to wrap it inside a <XDtClass:forAllClasses> tag or any other tag that processes a group of classes.

Parameters:
engine -
template - The body of the block tag
tagName - The tag to iterate
paramName - The tag parameter that should be used as identifier.
Throws:
XDocletException - if something goes wrong

forAllDistinctClassTags

public void forAllDistinctClassTags(java.lang.String template,
                                    java.util.Properties attributes)
                             throws XDocletException
Iterates over all tags named according to tagName in a non-duplicated manner. The paramName parameter specifies the tag parameter that should be unique during the iteration. Duplicated tags will generate a warning message. Please note that this tag already processes all classes. There is no need to wrap it inside a <XDtClass:forAllClasses> tag or any other tag that processes a group of classes.

Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - if something goes wrong
doc.tag
type = "block"
doc.param
name = "tagName" optional = "false" description = "The tag to iterate.", name = "tagKey" optional = "false" description = "The tag parameter that should be used as * identifier."

className

public java.lang.String className()
                           throws XDocletException
Returns the not-fully-qualified name of the current class without the package name.

Returns:
the name of the current class
Throws:
XDocletException - if something goes wrong
doc.tag
type = "content"

fullClassName

public java.lang.String fullClassName()
                               throws XDocletException
Returns the full-qualified name of the current class.

Returns:
the name of the current class
Throws:
XDocletException - if something goes wrong
doc.tag
type = "content"

transformedClassName

public java.lang.String transformedClassName()
                                      throws XDocletException
Returns the transformed name of the current class with package name.

Returns:
the name of the current class
Throws:
XDocletException - if something goes wrong
doc.tag
type = "content"

fullTransformedClassName

public java.lang.String fullTransformedClassName()
                                          throws XDocletException
Returns the fully-qualified transformed name of the current class with package name.

Returns:
the name of the current class
Throws:
XDocletException - if something goes wrong
doc.tag
type = "content"

fullSuperclassName

public java.lang.String fullSuperclassName()
                                    throws XDocletException
Returns the full-qualified name of the superclass of the current class.

Returns:
the name of the superclass of the current class
Throws:
XDocletException - if something goes wrong
doc.tag
type = "content"

classOf

public void classOf(java.lang.String template)
             throws XDocletException
Returns the not-full-qualified name of the full-qualified class name specified in the body of this tag.

Parameters:
template - The body of the block tag
Throws:
XDocletException - if something goes wrong
doc.tag
type = "block"

ifIsClassAbstract

public void ifIsClassAbstract(java.lang.String template)
                       throws XDocletException
Evaluate the body block if current class is abstract.

Parameters:
template - The body of the block tag
Throws:
XDocletException - Description of Exception
See Also:
ifIsClassNotAbstract(java.lang.String)
doc.tag
type = "block"

ifIsClassNotAbstract

public void ifIsClassNotAbstract(java.lang.String template)
                          throws XDocletException
Evaluate the body block if current class is not abstract.

Parameters:
template - The body of the block tag
Throws:
XDocletException - Description of Exception
See Also:
ifIsClassAbstract(java.lang.String)
doc.tag
type = "block"

pushClass

public void pushClass(java.lang.String template,
                      java.util.Properties attributes)
               throws XDocletException
Pushes the class specified by value parameter to top of stack making it the current class.

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 = "value" optional = "false" values = "return-type,whatever class name" description = "If return-type specified then push current method return type, else find the XClass for the * class name and push it."

forAllClasses

public void forAllClasses(java.lang.String template,
                          java.util.Properties attributes)
                   throws XDocletException
Iterates over all classes loaded by xjavadoc and evaluates the body of the tag for each class. It discards classes that have a xdoclet-generated class tag defined.

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 = "abstract" optional = "true" values = "true,false" description = "If true then accept * abstract classes also; otherwise don't.", name = "type" optional = "true" description = "For all classes by the type.", name = "extent" optional = "true" values = "concrete-type,superclass,hierarchy" description = "Specifies the extent of the type search. If concrete-type then only check the concrete type, if * superclass then check also superclass, if hierarchy then search the whole hierarchy and find if the class is * of the specified type. Default is hierarchy."

modifiers

public java.lang.String modifiers()
                           throws XDocletException
The current class' modifiers.

Returns:
modifiers
Throws:
XDocletException - Describe the exception
doc.tag
type = "content"

symbolicClassName

public java.lang.String symbolicClassName()
                                   throws XDocletException
Returns the symbolic name of the current class. For a java bean it's the same as the class name.

Returns:
The symbolic name of the current class
Throws:
XDocletException - Description of Exception
doc.tag
type = "content"

ifDoesntHaveClassTag

public void ifDoesntHaveClassTag(java.lang.String template,
                                 java.util.Properties attributes)
                          throws XDocletException
Evaluates the body if current class doesn't have at least one tag with the specified name.

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.", name = "paramName" description = "The parameter name. If not specified, then the raw * content of the tag is returned.", name = "paramNum" description = "The zero-based parameter number. It's used if the user * used the space-separated format for specifying parameters.", name = "superclasses" values = "true,false" description = "If true then traverse * superclasses also, otherwise look up the tag in current concrete class only.", name = "error" description = "Show this error message if no tag found."

ifHasClassTag

public void ifHasClassTag(java.lang.String template,
                          java.util.Properties attributes)
                   throws XDocletException
Evaluates the body if current class has at least one tag with the specified name.

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.", name = "paramName" description = "The parameter name. If not specified, then the raw * content of the tag is returned.", name = "paramNum" description = "The zero-based parameter number. It's used if the user * used the space-separated format for specifying parameters.", name = "superclasses" values = "true,false" description = "If true then traverse * superclasses also, otherwise look up the tag in current concrete class only.", name = "error" description = "Show this error message if no tag found."

ifClassTagValueMatches

public void ifClassTagValueMatches(java.lang.String template,
                                   java.util.Properties attributes)
                            throws XDocletException
Evaluate the body if the match variable equals with the value of the specified tag/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 = "values" description = "The valid values for the parameter, comma separated. An * error message is printed if the parameter value is not one of the values.", name = "default" description = "The default value is returned if parameter not specified * by user for the tag.", name = "superclasses" values = "true,false" description = "If true then traverse * superclasses also, otherwise look up the tag in current concrete class only."
To do:
(Aslak) It appears that this method does the same job as ifClassTagValueEquals. It also appears that no templates are using it. Candidate for removal?

ifClassTagValueEquals

public void ifClassTagValueEquals(java.lang.String template,
                                  java.util.Properties attributes)
                           throws XDocletException
Evaluates the body if value for the class tag equals the specified value.

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.", name = "paramName" description = "The parameter name. If not specified, then the raw * content of the tag is returned.", name = "paramNum" description = "The zero-based parameter number. It's used if the user * used the space-separated format for specifying parameters.", name = "value" optional = "false" description = "The desired value."

ifClassTagValueNotEquals

public void ifClassTagValueNotEquals(java.lang.String template,
                                     java.util.Properties attributes)
                              throws XDocletException
Evaluates the body if value for the class tag not equals the specified value.

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.", name = "paramName" description = "The parameter name. If not specified, then the raw * content of the tag is returned.", name = "paramNum" description = "The zero-based parameter number. It's used if the user * used the space-separated format for specifying parameters.", name = "value" optional = "false" description = "The desired value."

classTagValue

public java.lang.String classTagValue(java.util.Properties attributes)
                               throws XDocletException
Iterates over all class tags with the specified tagName and evaluates the body of the tag for each class tag.

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.", name = "paramName" description = "The parameter name. If not specified, then the raw * content of the tag is returned.", name = "paramNum" description = "The zero-based parameter number. It's used if the user * used the space-separated format for specifying parameters.", name = "values" description = "The valid values for the parameter, comma separated. An * error message is printed if the parameter value is not one of the values.", name = "default" description = "The default value is returned if parameter not specified * by user for the tag.", name = "superclasses" values = "true,false" description = "If true then traverse * superclasses also, otherwise look up the tag in current concrete class only.", name = "mandatory" values = "true,false" description = "Generate an error if parameter not * specified by user for the tag."

classTagValueMatch

public java.lang.String classTagValueMatch(java.util.Properties attributes)
                                    throws XDocletException
Sets 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 temaplte. This tag does not return any content, it just sets the match variable.

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.", name = "paramName" description = "The parameter name. If not specified, then the raw * content of the tag is returned.", name = "paramNum" description = "The zero-based parameter number. It's used if the user * used the space-separated format for specifying parameters."

forAllClassTags

public void forAllClassTags(java.lang.String template,
                            java.util.Properties attributes)
                     throws XDocletException
Iterates over all tags of current class with the name tagName and evaluates the body of the tag for each method.

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.", name = "superclasses" values = "true,false" description = "If true then traverse * superclasses also, otherwise look up the tag in current concrete class only.", name = "tagKey" description = "A tag property that will be used as a unique key. This is * used to avoid duplicate code due to similar tags in superclasses."

forAllClassTagTokens

public void forAllClassTagTokens(java.lang.String template,
                                 java.util.Properties attributes)
                          throws XDocletException
Iterates over all tokens in specified class tag with the name tagName and evaluates the body for every token.

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 name of the tag to look in.", name = "paramName" optional = "false" description = "The parameter of the tag whose value * is to be tokenized.", name = "superclasses" values = "true,false" description = "If true then traverse * superclasses also, otherwise look up the tag in current concrete class only.", name = "delimiter" description = "delimiter for the StringTokenizer. consult javadoc for * java.util.StringTokenizer default is ','", name = "skip" description = "how many tokens to skip on start"

classComment

public java.lang.String classComment(java.util.Properties attributes)
                              throws XDocletException
The comment for the current class.

Parameters:
attributes - The attributes of the template tag
Returns:
javadoc comment
Throws:
XDocletException - Description of Exception
See Also:
MethodTagsHandler.methodComment(java.util.Properties), classCommentText(java.util.Properties), classCommentTags(java.util.Properties)
doc.tag
type = "content"
doc.param
name = "no-comment-signs" optional = "true" values = "true,false" description = "If true * then don't decorate the comment with comment signs. Default is false.", name = "indent" optional = "true" description = "Number of spaces to indent the comment. * Default is 0."

classCommentText

public java.lang.String classCommentText(java.util.Properties attributes)
                                  throws XDocletException
The text of the javadoc comment for the current class.

Parameters:
attributes - The attributes of the template tag
Returns:
comment text
Throws:
XDocletException - Description of Exception
See Also:
MethodTagsHandler.methodComment(java.util.Properties), classComment(java.util.Properties)
doc.tag
type = "content"
doc.param
name = "no-comment-signs" optional = "true" values = "true,false" description = "If true * then don't decorate the comment with comment signs. Default is false.", name = "indent" optional = "true" description = "Number of spaces to indent the comment. * Default is 0."
To do:
handle inline link tags in comment text

classCommentTags

public java.lang.String classCommentTags(java.util.Properties attributes)
                                  throws XDocletException
The javadoc comment tags for the current class (plus xdoclet-generated).

Parameters:
attributes - The attributes of the template tag
Returns:
The class-level tags
Throws:
XDocletException - Description of Exception
See Also:
MethodTagsHandler.methodComment(java.util.Properties), classComment(java.util.Properties)
doc.tag
type = "content"
doc.param
name = "indent" optional = "true" description = "Number of spaces to indent the tags. * Default is 0."

firstSentenceDescription

public java.lang.String firstSentenceDescription(java.util.Properties attributes)
                                          throws XDocletException
Return first sentence of standard javadoc of current class.

Parameters:
attributes - The attributes of the template tag
Returns:
class comment's first sentence
Throws:
XDocletException - Description of Exception
doc.tag
type = "content"
doc.param
name = "no-description-if-lacking" optional = "true" description = "Returns 'No * Description' if comment is lacking."

importedList

public java.lang.String importedList(java.util.Properties attributes)
                              throws XDocletException
Deprecated. Make sure the template file uses full qualified class names everywhere instead.

Iterates over all imported classes and packages imported in the current class and returns the list. The composed string has 'import ' in front of each import statement, and each import is in a separate line.

Parameters:
attributes - The attributes of the template tag
Returns:
import statements
Throws:
XDocletException - Description of Exception
doc.tag
type = "content"
doc.param
name = "currentClass" optional = "false" description = "???"

http://xdoclet.sourceforge.net/