xdoclet.modules.ejb.env

Class EnvTagsHandler


public class EnvTagsHandler
extends xdoclet.XDocletTagSupport

Handles field level tag's for configuring a bean's environment.
Version:
$Revision: 1.3 $
Author:
Matthias Germann
xdoclet.taghandler
namespace = "EjbEnv"
created
March 31, 2005

Field Summary

protected XMember
currentMember
protected XTag
currentTag
protected int
currentTagType

Fields inherited from class xdoclet.XDocletTagSupport

FOR_CLASS, FOR_CONSTRUCTOR, FOR_FIELD, FOR_METHOD, PARAMETER_DELIMITER

Method Summary

protected void
doGenerate(String template)
Called for each tag in the forTags loop.
void
forAllMemberTags(String template, Properties attributes)
Executes the template for all method- and field-level tags with the passed name
void
forAllMethodTags(String template, Properties attributes)
Executes the template for all method-level tags with the passed name
void
forAllTags(String template, Properties attributes)
Executes the template for all class-, method- and field-level tags with the passed name
protected void
forTags(String template, Properties attributes, boolean forClass, boolean forMethod, boolean forField)
Executes the passed template for the passed
void
ifHasParam(String template, Properties attributes)
Executes the body only if the current tag has a specified parameter
void
ifHasTag(String template, Properties attributes)
Executes the body only if the current class has at least one ot the passed tags at field- or method-level
void
ifHasType(String template, Properties attributes)
Executes the body only if the current tag is either a method- or fiel-level tag or has a type parameter.
void
ifNotPrimitiveMember(String template, Properties attributes)
Executes the body only if the current field type or method return type is not a primitive.
void
ifParamValueEquals(String template, Properties attributes)
Executes the body only if the specified tag's value is equal to the specified value
void
ifParamValueNotEquals(String template, Properties attributes)
Executes the body only if the specified tag's value is equal to the specified value
void
ifPrimitiveMember(String template, Properties attributes)
Executes the body only if the current field type or method return type is primitive.
String
memberName(Properties attributes)
Returns the method or field name.
String
memberType()
Returns the method's return type or the field's type.
String
methodSignature()
Returns the method signature for the current method.
String
name(Properties attributes)
Returns the name parameter value for the current tag.
String
paramValue(Properties attributes)
Returns the value of a parameter.
String
type(Properties attributes)
Returns the type parameter value for the current tag.

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

Field Details

currentMember

protected XMember currentMember

currentTag

protected XTag currentTag

currentTagType

protected int currentTagType

Method Details

doGenerate

protected void doGenerate(String template)
            throws xdoclet.XDocletException
Called for each tag in the forTags loop. The default behaviour is to call generate(template)
Parameters:
template - the template
Throws:
xdoclet.XDocletException - if an error occures

forAllMemberTags

public void forAllMemberTags(String template,
                             Properties attributes)
            throws xdoclet.XDocletException
Executes the template for all method- and field-level tags with the passed name
Parameters:
template - the template
attributes - the attributes
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "block"
doc.param
name = "tagName" optional = "false" description = "the tag name"
name = "paramName" optional = "true" description = "the required parameter"
name = "paramValue" optional = "true" description = "the value for the required parameter"

forAllMethodTags

public void forAllMethodTags(String template,
                             Properties attributes)
            throws xdoclet.XDocletException
Executes the template for all method-level tags with the passed name
Parameters:
template - the template
attributes - the attributes
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "block"
doc.param
name = "tagName" optional = "false" description = "the tag name"
name = "paramName" optional = "true" description = "the required parameter"
name = "paramValue" optional = "true" description = "the value for the required parameter"

forAllTags

public void forAllTags(String template,
                       Properties attributes)
            throws xdoclet.XDocletException
Executes the template for all class-, method- and field-level tags with the passed name
Parameters:
template - the template
attributes - the attributes
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "block"
doc.param
name = "tagName" optional = "false" description = "the tag name"
name = "paramName" optional = "true" description = "the required parameter"
name = "paramValue" optional = "true" description = "the value for the required parameter"

forTags

protected void forTags(String template,
                       Properties attributes,
                       boolean forClass,
                       boolean forMethod,
                       boolean forField)
            throws xdoclet.XDocletException
Executes the passed template for the passed
Parameters:
template - the template
attributes - the parameters
forClass - indicates whether the template should be excuted for class level tags
forMethod - indicates whether the template should be excuted for method level tags
forField - indicates whether the template should be excuted for field level tags
Throws:
xdoclet.XDocletException - if an error occures

ifHasParam

public void ifHasParam(String template,
                       Properties attributes)
            throws xdoclet.XDocletException
Executes the body only if the current tag has a specified parameter
Parameters:
template - the template
attributes - the attributes
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "body"
doc.param
name = "paramName" optional = "false" description = "the name of the parameter"

ifHasTag

public void ifHasTag(String template,
                     Properties attributes)
            throws xdoclet.XDocletException
Executes the body only if the current class has at least one ot the passed tags at field- or method-level
Parameters:
template - the template
attributes - the attributes
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "block"
doc.param
name = "tagName" optional = "false" description = "the tag names (comma separated)"
name = "paramName" optional = "true" description = "tags must have this parameter"
name = "paramValue" optional = "true" description = "tags must have this value for the parameter with 'paramName'"

ifHasType

public void ifHasType(String template,
                      Properties attributes)
            throws xdoclet.XDocletException
Executes the body only if the current tag is either a method- or fiel-level tag or has a type parameter.
Parameters:
template - the template
attributes - the attributes
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "block"
doc.param
name = "paramName" optional = "false" description = "the name of the name parameter"

ifNotPrimitiveMember

public void ifNotPrimitiveMember(String template,
                                 Properties attributes)
            throws xdoclet.XDocletException
Executes the body only if the current field type or method return type is not a primitive.
Parameters:
template - the template
attributes - the attributes
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "block"

ifParamValueEquals

public void ifParamValueEquals(String template,
                               Properties attributes)
            throws xdoclet.XDocletException
Executes the body only if the specified tag's value is equal to the specified value
Parameters:
template - the template
attributes - the attributes
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "body"
doc.param
name = "paramName" optional = "false" description = "the name of the parameter"
name = "value" optional = "false" description = "the value of the parameter"

ifParamValueNotEquals

public void ifParamValueNotEquals(String template,
                                  Properties attributes)
            throws xdoclet.XDocletException
Executes the body only if the specified tag's value is equal to the specified value
Parameters:
template - the template
attributes - the attributes
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "body"
doc.param
name = "paramName" optional = "false" description = "the name of the parameter"
name = "value" optional = "false" description = "the value of the parameter"

ifPrimitiveMember

public void ifPrimitiveMember(String template,
                              Properties attributes)
            throws xdoclet.XDocletException
Executes the body only if the current field type or method return type is primitive.
Parameters:
template - the template
attributes - the attributes
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "block"

memberName

public String memberName(Properties attributes)
            throws xdoclet.XDocletException
Returns the method or field name. Can only be used inside forAllMemberTags or forAllMethodTags .
Parameters:
attributes - the attributes
Returns:
the memeber's name
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "content"
doc.param
name = "prefix" optional = "true" description = "the prefix for the name"

memberType

public String memberType()
            throws xdoclet.XDocletException
Returns the method's return type or the field's type. Can only be used inside forAllMemberTags or forAllMethodTags.
Returns:
the member's type
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "content"

methodSignature

public String methodSignature()
            throws xdoclet.XDocletException
Returns the method signature for the current method. Can only be used inside forAllMethodTags.
Returns:
the current method's signature
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "content"

name

public String name(Properties attributes)
            throws xdoclet.XDocletException
Returns the name parameter value for the current tag. If the name parameter is not specified for a method- or field-level tag, the member's name is returned. If the name parameter is not specified for a class level tag, an error is generated.
Parameters:
attributes - the attributes
Returns:
the name
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "content"
doc.param
name = "paramName" optional = "false" description = "the name of the name parameter"

paramValue

public String paramValue(Properties attributes)
            throws xdoclet.XDocletException
Returns the value of a parameter.
Parameters:
attributes - the attributes
Returns:
the value
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "content"
doc.param
name = "paramName" optional = "false" description = "the name of the parameter"
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 = "mandatory" values = "true,false" description = "Generate an error if parameter not

type

public String type(Properties attributes)
            throws xdoclet.XDocletException
Returns the type parameter value for the current tag. Returns the field type for field-level tags and the return value for method-level tags. For class-level tags, the value of the type parameter is returned. The wrapper class is returned for primitive fields an methods with primitive return values.
Parameters:
attributes - the attributes
Returns:
the type
Throws:
xdoclet.XDocletException - if an error occures
doc.tag
type = "content"
doc.param
name = "paramName" optional = "false" description = "the name of the type parameter"
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 = "mandatory" values = "true,false" description = "Generate an error if parameter not