xdoclet.tags
Class ConstructorTagsHandler

java.lang.Object
  |
  +--xdoclet.template.TemplateTagHandler
        |
        +--xdoclet.XDocletTagSupport
              |
              +--xdoclet.tags.AbstractProgramElementTagsHandler
                    |
                    +--xdoclet.tags.ConstructorTagsHandler

public class ConstructorTagsHandler
extends AbstractProgramElementTagsHandler

Version:
$Revision: 1.4 $
Author:
Jerome Bernard (jerome.bernard@xtremejava.com)

Fields inherited from class xdoclet.tags.AbstractProgramElementTagsHandler
currentToken, matchPattern, tagTokenizer
 
Fields inherited from class xdoclet.XDocletTagSupport
FOR_CLASS, FOR_CONSTRUCTOR, FOR_FIELD, FOR_METHOD, PARAMETER_DELIMITER
 
Constructor Summary
ConstructorTagsHandler()
           
 
Method Summary
 java.lang.String constructorComment(java.util.Properties attributes)
          The comment for the current constructor.
 java.lang.String constructorName(java.util.Properties attributes)
          Returns the name of the current constructor.
 java.lang.String constructorTagValue(java.util.Properties attributes)
          Iterates over all constructor tags with the specified tagName for the current constructor probably inside of a forAllConstructorTags body.
 java.lang.String currentConstructorName()
          Returns the current constructor name.
 java.lang.String exceptionList(java.util.Properties attributes)
          Iterates over all exceptions thrown by the current constructor and returns a string containing definition of all those exceptions.
 void executeAndRestoreConstructor(java.lang.String template, java.util.Properties attributes)
          Evaluate the current block, and then restore the current constructor before continuing.
 java.lang.String firstSentenceDescriptionOfCurrentConstructor()
          Return standard javadoc of current constructor.
 void forAllClassConstructors(java.lang.String template, java.util.Properties attributes)
          Loops through all constructors for all classes after first sorting all the constructors.
 void forAllConstructors(java.lang.String template, java.util.Properties attributes)
          Iterates over all constructors of current class and evaluates the body of the tag for each constructor.
 void forAllConstructorTags(java.lang.String template, java.util.Properties attributes)
          Iterates over all tags of current constructor and evaluates the body of the tag for each constructor.
 void forAllConstructorTagTokens(java.lang.String template, java.util.Properties attributes)
          Iterates over all tokens in current constructor tag with the name tagName and evaluates the body for every token.
protected static boolean hasConstructor(com.sun.javadoc.ClassDoc clazz, java.lang.String constructorName, java.lang.String[] parameters, boolean setCurrentConstructor)
          Returns true if a constructor with the specified parameters is found in the class clazz.
 void ifConstructorTagValueEquals(java.lang.String template, java.util.Properties attributes)
          Evaluates the body if value for the constructor tag equals the specified value.
 void ifConstructorTagValueNotEquals(java.lang.String template, java.util.Properties attributes)
          Evaluates the body if value for the constructor tag not equals the specified value.
 void ifDoesntHaveConstructor(java.lang.String template, java.util.Properties attributes)
          Evaluate the body if current class doesn't have a constructor with the specified name+parameters.
 void ifDoesntHaveConstructorTag(java.lang.String template, java.util.Properties attributes)
          Evaluates the body if current constructor doesn't have at least one tag with the specified name.
 void ifHasConstructor(java.lang.String template, java.util.Properties attributes)
          Evaluate the body if current class has a constructor with the specified name+parameters.
 void ifHasConstructorTag(java.lang.String template, java.util.Properties attributes)
          Evaluates the body if current constructor has at least one tag with the specified name.
 void setCurrentConstructor(java.lang.String template, java.util.Properties attributes)
          Evaluate the body if current class has a constructor with the specified name+parameters.
 
Methods inherited from class xdoclet.tags.AbstractProgramElementTagsHandler
checkForWrap, currentToken, exceptionList, forAllMembers, forAllMemberTags, forAllMemberTagTokens, getAllClasses, getClassNameFor, getExecutableMemberDocForMemberName, getExecutableMemberDocForMemberName, getFullClassNameFor, getFullSuperclassNameFor, getIndentChars, hasExecutableMember, ifHasTag_Impl, ifTagValueEquals_Impl, matchValue, memberComment, setMatchValue, skipToken
 
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
 

Constructor Detail

ConstructorTagsHandler

public ConstructorTagsHandler()
Method Detail

hasConstructor

protected static boolean hasConstructor(com.sun.javadoc.ClassDoc clazz,
                                        java.lang.String constructorName,
                                        java.lang.String[] parameters,
                                        boolean setCurrentConstructor)
                                 throws XDocletException
Returns true if a constructor with the specified parameters is found in the class clazz. The parameters array can be empty, if so any constructor with any set of parameters is considered equal to the constructor we're searching for. If not empty, all parameters of the constructor must be equal to the ones specified in parameters array to have "constructor equality".
Parameters:
clazz - Description of Parameter
constructorName - Description of Parameter
parameters - Description of Parameter
setCurrentConstructor -  
Returns:
Description of the Returned Value
Throws:
XDocletException -  

setCurrentConstructor

public void setCurrentConstructor(java.lang.String template,
                                  java.util.Properties attributes)
                           throws XDocletException
Evaluate the body if current class has a constructor with the specified name+parameters. If parameters not specified then any constructor with the given name and any set of parameters is considered equal to the given constructor name and so the test result is positive and the body is evaluated. This constructor change the current constructor to the one specified.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - Description of Exception
See Also:
ifHasConstructor(java.lang.String,java.util.Properties)

constructorComment

public java.lang.String constructorComment(java.util.Properties attributes)
                                    throws XDocletException
The comment for the current constructor.
Parameters:
attributes - The attributes of the template tag
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception
See Also:
ClassTagsHandler.classComment(java.util.Properties)

exceptionList

public java.lang.String exceptionList(java.util.Properties attributes)
                               throws XDocletException
Iterates over all exceptions thrown by the current constructor and returns a string containing definition of all those exceptions.
Parameters:
attributes - The attributes of the template tag
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

forAllClassConstructors

public void forAllClassConstructors(java.lang.String template,
                                    java.util.Properties attributes)
                             throws XDocletException
Loops through all constructors for all classes after first sorting all the constructors.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - Description of Exception

forAllConstructors

public void forAllConstructors(java.lang.String template,
                               java.util.Properties attributes)
                        throws XDocletException
Iterates over all constructors of current class and evaluates the body of the tag for each constructor.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - Description of Exception

ifDoesntHaveConstructorTag

public void ifDoesntHaveConstructorTag(java.lang.String template,
                                       java.util.Properties attributes)
                                throws XDocletException
Evaluates the body if current constructor 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

ifHasConstructorTag

public void ifHasConstructorTag(java.lang.String template,
                                java.util.Properties attributes)
                         throws XDocletException
Evaluates the body if current constructor 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

executeAndRestoreConstructor

public void executeAndRestoreConstructor(java.lang.String template,
                                         java.util.Properties attributes)
                                  throws XDocletException
Evaluate the current block, and then restore the current constructor before continuing.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - Description of Exception

ifConstructorTagValueEquals

public void ifConstructorTagValueEquals(java.lang.String template,
                                        java.util.Properties attributes)
                                 throws XDocletException
Evaluates the body if value for the constructor 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

ifConstructorTagValueNotEquals

public void ifConstructorTagValueNotEquals(java.lang.String template,
                                           java.util.Properties attributes)
                                    throws XDocletException
Evaluates the body if value for the constructor 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

constructorTagValue

public java.lang.String constructorTagValue(java.util.Properties attributes)
                                     throws XDocletException
Iterates over all constructor tags with the specified tagName for the current constructor probably inside of a forAllConstructorTags body.
Parameters:
attributes - The attributes of the template tag
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

forAllConstructorTags

public void forAllConstructorTags(java.lang.String template,
                                  java.util.Properties attributes)
                           throws XDocletException
Iterates over all tags of current constructor and evaluates the body of the tag for each constructor.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - Description of Exception

forAllConstructorTagTokens

public void forAllConstructorTagTokens(java.lang.String template,
                                       java.util.Properties attributes)
                                throws XDocletException
Iterates over all tokens in current constructor 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

firstSentenceDescriptionOfCurrentConstructor

public java.lang.String firstSentenceDescriptionOfCurrentConstructor()
                                                              throws XDocletException
Return standard javadoc of current constructor.
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

constructorName

public java.lang.String constructorName(java.util.Properties attributes)
                                 throws XDocletException
Returns the name of the current constructor.
Parameters:
attributes - The attributes of the template tag
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

currentConstructorName

public java.lang.String currentConstructorName()
                                        throws XDocletException
Returns the current constructor name. Used inside block elements.
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

ifHasConstructor

public void ifHasConstructor(java.lang.String template,
                             java.util.Properties attributes)
                      throws XDocletException
Evaluate the body if current class has a constructor with the specified name+parameters. If parameters not specified then any constructor with the given name and any set of parameters is considered equal to the given constructor name and so the test result is positive and the body is evaluated. This constructor does not change the current constructor to the one specified.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - Description of Exception
See Also:
ifDoesntHaveConstructor(java.lang.String,java.util.Properties)

ifDoesntHaveConstructor

public void ifDoesntHaveConstructor(java.lang.String template,
                                    java.util.Properties attributes)
                             throws XDocletException
Evaluate the body if current class doesn't have a constructor with the specified name+parameters. If parameters not specified then any constructor with the given name and any set of parameters is considered equal to the given constructor name and so the test result is positive and the body is evaluated.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
Throws:
XDocletException - Description of Exception
See Also:
ifHasConstructor(java.lang.String,java.util.Properties)