xdoclet.modules.ejb.env

Class EnvTagsHandler

public class EnvTagsHandler extends XDocletTagSupport

Handles field level tag's for configuring a bean's environment.

Version: $Revision: 1.3 $

Author: Matthias Germann

UNKNOWN: March 31, 2005 namespace = "EjbEnv"

Field Summary
protected XMembercurrentMember
protected XTagcurrentTag
protected intcurrentTagType
Method Summary
protected voiddoGenerate(String template)
Called for each tag in the forTags loop.
voidforAllMemberTags(String template, Properties attributes)
Executes the template for all method- and field-level tags with the passed name
voidforAllMethodTags(String template, Properties attributes)
Executes the template for all method-level tags with the passed name
voidforAllTags(String template, Properties attributes)
Executes the template for all class-, method- and field-level tags with the passed name
protected voidforTags(String template, Properties attributes, boolean forClass, boolean forMethod, boolean forField)
Executes the passed template for the passed
voidifHasParam(String template, Properties attributes)
Executes the body only if the current tag has a specified parameter
voidifHasTag(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
voidifHasType(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.
voidifNotPrimitiveMember(String template, Properties attributes)
Executes the body only if the current field type or method return type is not a primitive.
voidifParamValueEquals(String template, Properties attributes)
Executes the body only if the specified tag's value is equal to the specified value
voidifParamValueNotEquals(String template, Properties attributes)
Executes the body only if the specified tag's value is equal to the specified value
voidifPrimitiveMember(String template, Properties attributes)
Executes the body only if the current field type or method return type is primitive.
StringmemberName(Properties attributes)
Returns the method or field name.
StringmemberType()
Returns the method's return type or the field's type.
StringmethodSignature()
Returns the method signature for the current method.
Stringname(Properties attributes)
Returns the name parameter value for the current tag.
StringparamValue(Properties attributes)
Returns the value of a parameter.
Stringtype(Properties attributes)
Returns the type parameter value for the current tag.

Field Detail

currentMember

protected XMember currentMember

currentTag

protected XTag currentTag

currentTagType

protected int currentTagType

Method Detail

doGenerate

protected void doGenerate(String template)
Called for each tag in the forTags loop. The default behaviour is to call generate(template)

Parameters: template the template

Throws: XDocletException if an error occures

forAllMemberTags

public void forAllMemberTags(String template, Properties attributes)
Executes the template for all method- and field-level tags with the passed name

Parameters: template the template attributes the attributes

Throws: XDocletException if an error occures

UNKNOWN: 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" type = "block"

forAllMethodTags

public void forAllMethodTags(String template, Properties attributes)
Executes the template for all method-level tags with the passed name

Parameters: template the template attributes the attributes

Throws: XDocletException if an error occures

UNKNOWN: 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" type = "block"

forAllTags

public void forAllTags(String template, Properties attributes)
Executes the template for all class-, method- and field-level tags with the passed name

Parameters: template the template attributes the attributes

Throws: XDocletException if an error occures

UNKNOWN: 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" type = "block"

forTags

protected void forTags(String template, Properties attributes, boolean forClass, boolean forMethod, boolean forField)
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: XDocletException if an error occures

ifHasParam

public void ifHasParam(String template, Properties attributes)
Executes the body only if the current tag has a specified parameter

Parameters: template the template attributes the attributes

Throws: XDocletException if an error occures

UNKNOWN: name = "paramName" optional = "false" description = "the name of the parameter" type = "body"

ifHasTag

public 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

Parameters: template the template attributes the attributes

Throws: XDocletException if an error occures

UNKNOWN: type = "block" 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)
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: XDocletException if an error occures

UNKNOWN: name = "paramName" optional = "false" description = "the name of the name parameter" type = "block"

ifNotPrimitiveMember

public void ifNotPrimitiveMember(String template, Properties attributes)
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: XDocletException if an error occures

UNKNOWN: type = "block"

ifParamValueEquals

public void ifParamValueEquals(String template, Properties attributes)
Executes the body only if the specified tag's value is equal to the specified value

Parameters: template the template attributes the attributes

Throws: XDocletException if an error occures

UNKNOWN: name = "paramName" optional = "false" description = "the name of the parameter" name = "value" optional = "false" description = "the value of the parameter" type = "body"

ifParamValueNotEquals

public void ifParamValueNotEquals(String template, Properties attributes)
Executes the body only if the specified tag's value is equal to the specified value

Parameters: template the template attributes the attributes

Throws: XDocletException if an error occures

UNKNOWN: name = "paramName" optional = "false" description = "the name of the parameter" name = "value" optional = "false" description = "the value of the parameter" type = "body"

ifPrimitiveMember

public void ifPrimitiveMember(String template, Properties attributes)
Executes the body only if the current field type or method return type is primitive.

Parameters: template the template attributes the attributes

Throws: XDocletException if an error occures

UNKNOWN: type = "block"

memberName

public String memberName(Properties attributes)
Returns the method or field name. Can only be used inside forAllMemberTags or forAllMethodTags .

Parameters: attributes the attributes

Returns: the memeber's name

Throws: XDocletException if an error occures

UNKNOWN: name = "prefix" optional = "true" description = "the prefix for the name" type = "content"

memberType

public String memberType()
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: XDocletException if an error occures

UNKNOWN: type = "content"

methodSignature

public String methodSignature()
Returns the method signature for the current method. Can only be used inside forAllMethodTags.

Returns: the current method's signature

Throws: XDocletException if an error occures

UNKNOWN: type = "content"

name

public String name(Properties attributes)
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: XDocletException if an error occures

UNKNOWN: name = "paramName" optional = "false" description = "the name of the name parameter" type = "content"

paramValue

public String paramValue(Properties attributes)
Returns the value of a parameter.

Parameters: attributes the attributes

Returns: the value

Throws: XDocletException if an error occures

UNKNOWN: 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 = "content"

type

public String type(Properties attributes)
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: XDocletException if an error occures

UNKNOWN: 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 * type = "content"