xdoclet.tagshandler
Class ConstructorTagsHandler

java.lang.Object
  extended byxdoclet.template.TemplateTagHandler
      extended byxdoclet.XDocletTagSupport
          extended byxdoclet.tagshandler.AbstractProgramElementTagsHandler
              extended byxdoclet.tagshandler.ConstructorTagsHandler

public class ConstructorTagsHandler
extends AbstractProgramElementTagsHandler

Version:
$Revision: 1.13 $
Author:
Jerome Bernard (jerome.bernard@xtremejava.com)
xdoclet.taghandler
namespace="Constructor"
created
Jan 18, 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
ConstructorTagsHandler()
           
 
Method Summary
 String constructorComment(Properties attributes)
          The comment for the current constructor.
 String constructorName(Properties attributes)
          Returns the name of the current constructor.
 String constructorTagValue(Properties attributes)
          Iterates over all constructor tags with the specified tagName for the current constructor probably inside of a forAllConstructorTags body.
 String currentConstructorName()
          Returns the current constructor name.
 String exceptionList(Properties attributes)
          Iterates over all exceptions thrown by the current or specified constructor and returns a string containing definition of all those exceptions.
 void executeAndRestoreConstructor(String template, Properties attributes)
          Evaluate the current block, and then restore the current constructor before continuing.
 String firstSentenceDescriptionOfCurrentConstructor()
          Return standard javadoc of current constructor.
 void forAllClassConstructors(String template, Properties attributes)
          Loops through all constructors for all classes after first sorting all the constructors.
 void forAllConstructors(String template, Properties attributes)
          Iterates over all constructors of current class and evaluates the body of the tag for each constructor.
 void forAllConstructorTags(String template, Properties attributes)
          Iterates over all tags of current constructor and evaluates the body of the tag for each constructor.
 void forAllConstructorTagTokens(String template, Properties attributes)
          Iterates over all tokens in current constructor tag with the name tagName and evaluates the body for every token.
 void ifConstructorTagValueEquals(String template, Properties attributes)
          Evaluates the body if value for the constructor tag equals the specified value.
 void ifConstructorTagValueNotEquals(String template, Properties attributes)
          Evaluates the body if value for the constructor tag not equals the specified value.
 void ifDoesntHaveConstructor(String template, Properties attributes)
          Evaluate the body if current class doesn't have a constructor with the specified name+parameters.
 void ifDoesntHaveConstructorTag(String template, Properties attributes)
          Evaluates the body if current constructor doesn't have at least one tag with the specified name.
 void ifHasConstructor(String template, Properties attributes)
          Evaluate the body if current class has a constructor with the specified name+parameters.
 void ifHasConstructorTag(String template, Properties attributes)
          Evaluates the body if current constructor has at least one tag with the specified name.
 String modifiers()
          Describe what the method does
 void setCurrentConstructor(String template, Properties attributes)
          Evaluate the body if current class has a constructor with the specified name+parameters.
 
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

ConstructorTagsHandler

public ConstructorTagsHandler()
Method Detail

setCurrentConstructor

public void setCurrentConstructor(String template,
                                  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)
doc.tag
type="block"
doc.param
name="name" optional="false" description="The name of the constructor we're searching for its existence in current class.", name="parameters" optional="true" description="We're searching for a constructor that has the exact set of parameters specified in parameters param.", name="delimiter" optional="true" description="The parameters param is delimited by the string specified in delimiter parameter."

constructorComment

public String constructorComment(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)
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.", name="indent" optional="true" description="Number of spaces to indent the comment. Default is 0."

exceptionList

public String exceptionList(Properties attributes)
                     throws XDocletException
Iterates over all exceptions thrown by the current or specified constructor and returns a string containing definition of all those exceptions.

Parameters:
attributes - The attributes of the template tag
Returns:
throws clause for the constructor
Throws:
XDocletException - Description of Exception
doc.tag
type="block"
doc.param
name="constructor" optional="true" description="The constructor name of which exceptions list is extracted. If not specified then current constructor is used.", name="skip" optional="true" description="A comma-separated list of exceptions that should be skipped and not put into the list.", name="append" optional="true" description="A comma-separated list of exceptions that should be always appended regardless if current constructor has that exception defined or not."

forAllClassConstructors

public void forAllClassConstructors(String template,
                                    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
doc.tag
type="block"
doc.param
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."

forAllConstructors

public void forAllConstructors(String template,
                               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
doc.tag
type="block"
doc.param
name="superclasses" optional="true" values="true,false" description="If true then traverse superclasses also, otherwise look up the tag in current concrete class only.", name="sort" optional="true" values="true,false" description="If true then sort the constructors list."

ifDoesntHaveConstructorTag

public void ifDoesntHaveConstructorTag(String template,
                                       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
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="error" description="Show this error message if no tag found."

ifHasConstructorTag

public void ifHasConstructorTag(String template,
                                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
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="error" description="Show this error message if no tag found."

executeAndRestoreConstructor

public void executeAndRestoreConstructor(String template,
                                         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
doc.tag
type="block"

ifConstructorTagValueEquals

public void ifConstructorTagValueEquals(String template,
                                        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
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."

ifConstructorTagValueNotEquals

public void ifConstructorTagValueNotEquals(String template,
                                           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
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."

constructorTagValue

public String constructorTagValue(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
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."

forAllConstructorTags

public void forAllConstructorTags(String template,
                                  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
doc.tag
type="block"
doc.param
name="tagName" optional="false" description="The tag name."

forAllConstructorTagTokens

public void forAllConstructorTagTokens(String template,
                                       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
doc.tag
type="block"
doc.param
name="tagName" optional="false" description="The tag name.", 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"

firstSentenceDescriptionOfCurrentConstructor

public String firstSentenceDescriptionOfCurrentConstructor()
                                                    throws XDocletException
Return standard javadoc of current constructor.

Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception
doc.tag
type="content"

modifiers

public String modifiers()
                 throws XDocletException
Describe what the method does

Returns:
Describe the return value
Throws:
XDocletException - Describe the exception

constructorName

public String constructorName(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
doc.tag
type="content"

currentConstructorName

public 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(String template,
                             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)
doc.tag
type="block"
doc.param
name="name" optional="false" description="The name of the constructor we're searching for its existence in current class.", name="parameters" optional="true" description="We're searching for a constructor that has the exact set of parameters specified in parameters param.", name="delimiter" optional="true" description="The parameters param is delimited by the string specified in delimiter parameter."

ifDoesntHaveConstructor

public void ifDoesntHaveConstructor(String template,
                                    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)
doc.tag
type="block"
doc.param
name="name" optional="false" description="The name of the constructor we're searching for its existence in current class.", name="parameters" optional="true" description="We're searching for a constructor that has the exact set of parameters specified in parameters param.", name="delimiter" optional="true" description="The parameters param is delimited by the string specified in delimiter parameter."

http://xdoclet.sourceforge.net/