xdoclet.tagshandler

Class TypeTagsHandler

public class TypeTagsHandler extends XDocletTagSupport

Simple tag support class.

Version: $Revision: 1.16 $

Author: Dmitri Colebatch (dim@bigpond.net.au)

UNKNOWN: October 12, 2001 namespace = "Type"

Field Summary
static intTYPE_CONCRETE_TYPE
Used by TypeTagsHandler.
static intTYPE_HIERARCHY
Used by TypeTagsHandler.
static intTYPE_SUPERCLASS
Used by TypeTagsHandler.
Method Summary
static intextractExtentType(String extent_str)
Return the integer constant based on the extent_str.
voidifIsNotOfType(String template, Properties attributes)
Evaluate the body block if the entity is not of the specified type.
voidifIsNotPrimitive(String template, Properties attributes)
Evaluate the body block if the value is not of a primitive type.
voidifIsNotPrimitiveArray(String template, Properties attributes)
Evaluate the body block if the value is not of a primitive array type.
voidifIsNotPrimitiveOrString(String template, Properties attributes)
Evaluate the body block if the value is of a primitive type or String.
voidifIsOfType(String template, Properties attributes)
Evaluate the body block if the entity is of the specified type.
protected voidifIsOfType_Impl(String template, Properties attributes, boolean condition)
Implementation of ifIsOfType and ifIsNotOfType tags.
voidifIsPrimitive(String template, Properties attributes)
Evaluate the body block if the value is of a primitive type.
voidifIsPrimitiveArray(String template, Properties attributes)
Evaluate the body block if the value is of a primitive array type.
voidifIsPrimitiveOrString(String template, Properties attributes)
Evaluate the body block if the value is of a primitive type or String.
static booleanisOfType(XClass clazz, String type, int extent)
Returns true if cur_class is of type type.
static booleanisPrimitiveArray(String name)
Returns true if name is a primitive type and is an array (ends with [])
static booleanisPrimitiveType(String name)
Returns true if name is a primitive type, in that case name contains the string "int"/"float"/etc.
StringtypeWithoutDimensions(Properties attributes)
Returns the type specified with the type parameter without dimensions.

Field Detail

TYPE_CONCRETE_TYPE

public static final int TYPE_CONCRETE_TYPE
Used by TypeTagsHandler. The isOfType method searches for the type according to the type parameter. TYPE_CONCRETE_TYPE specifies that only the type of the current entity (class, method return type, parameter type depending on the context) should be checked for equality.

TYPE_HIERARCHY

public static final int TYPE_HIERARCHY
Used by TypeTagsHandler. The isOfType method searches for the type according to the type parameter. TYPE_HIERARCHY specifies that not only the type of the current entity (class, method return type, parameter type depending on the context) should be checked for equality, but also superclasses and interfaces of the entity and recursively superclasses and interfaces.

TYPE_SUPERCLASS

public static final int TYPE_SUPERCLASS
Used by TypeTagsHandler. The isOfType method searches for the type according to the type parameter. TYPE_SUPERCLASS specifies that not only the type of the current entity (class, method return type, parameter type depending on the context) should be checked for equality, but also direct superclasses and interfaces of the entity.

Method Detail

extractExtentType

public static int extractExtentType(String extent_str)
Return the integer constant based on the extent_str. Used by forAllClasses and ifIsOfType_Impl. If the string doesn't have one of the expected values TYPE_HIERARCHY is returned.

Parameters: extent_str Description of Parameter

Returns: Description of the Returned Value

See Also: ClassTagsHandler TypeTagsHandler TYPE_HIERARCHY TYPE_CONCRETE_TYPE TYPE_SUPERCLASS

ifIsNotOfType

public void ifIsNotOfType(String template, Properties attributes)
Evaluate the body block if the entity is not of the specified type.

Parameters: template The body of the block tag attributes The attributes of the template tag

Throws: XDocletException Description of Exception

See Also: TypeTagsHandler

UNKNOWN: type = "block" name = "value" optional = "false" values = "class,return-type" description = "If class then * check current class's type, if return-type then check current method return type, if property-type and the * current method is a getter or setter then check current method's property type. Default is class." name = "type" optional = "false" description = "The type we are checking against." 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."

ifIsNotPrimitive

public void ifIsNotPrimitive(String template, Properties attributes)
Evaluate the body block if the value is not of a primitive type.

Parameters: template The body of the block tag attributes The attributes of the template tag

Throws: XDocletException If the evaluation of the body block fails.

See Also: TypeTagsHandler TypeTagsHandler

UNKNOWN: type = "block" name = "value" optional = "false" description = "A string containsing the type name."

ifIsNotPrimitiveArray

public void ifIsNotPrimitiveArray(String template, Properties attributes)
Evaluate the body block if the value is not of a primitive array type.

Parameters: template The body of the block tag attributes The attributes of the template tag

Throws: XDocletException Description of Exception

See Also: TypeTagsHandler TypeTagsHandler

UNKNOWN: type = "block" name = "value" optional = "false" description = "A string containsing the type name."

ifIsNotPrimitiveOrString

public void ifIsNotPrimitiveOrString(String template, Properties attributes)
Evaluate the body block if the value is of a primitive type or String.

Parameters: template The body of the block tag attributes The attributes of the template tag

Throws: XDocletException Description of Exception

See Also: TypeTagsHandler TypeTagsHandler

UNKNOWN: type = "block" name = "value" optional = "false" description = "A string containsing the type name."

ifIsOfType

public void ifIsOfType(String template, Properties attributes)
Evaluate the body block if the entity is of the specified type.

Parameters: template The body of the block tag attributes The attributes of the template tag

Throws: XDocletException Description of Exception

See Also: TypeTagsHandler

UNKNOWN: type = "block" name = "value" optional = "true" values = "class,return-type,property-type" description = "If class then check current class's type, if return-type then check current method return type, * if property-type and the current method is a getter or setter then check current method's property type. * Default is class." name = "type" optional = "false" description = "The type we are checking against." 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."

ifIsOfType_Impl

protected void ifIsOfType_Impl(String template, Properties attributes, boolean condition)
Implementation of ifIsOfType and ifIsNotOfType tags.

Parameters: template The body of the block tag attributes The attributes of the template tag condition Whether to look for a match (true) or non-match (false)

Throws: XDocletException Description of Exception

See Also: TypeTagsHandler TypeTagsHandler

ifIsPrimitive

public void ifIsPrimitive(String template, Properties attributes)
Evaluate the body block if the value is of a primitive type.

Parameters: template The body of the block tag attributes The attributes of the template tag

Throws: XDocletException Description of Exception

See Also: TypeTagsHandler TypeTagsHandler

UNKNOWN: type = "block" name = "value" optional = "false" description = "A string containsing the type name."

ifIsPrimitiveArray

public void ifIsPrimitiveArray(String template, Properties attributes)
Evaluate the body block if the value is of a primitive array type.

Parameters: template The body of the block tag attributes The attributes of the template tag

Throws: XDocletException Description of Exception

See Also: TypeTagsHandler TypeTagsHandler

UNKNOWN: type = "block" name = "value" optional = "false" description = "A string containsing the type name."

ifIsPrimitiveOrString

public void ifIsPrimitiveOrString(String template, Properties attributes)
Evaluate the body block if the value is of a primitive type or String.

Parameters: template The body of the block tag attributes The attributes of the template tag

Throws: XDocletException Description of Exception

See Also: TypeTagsHandler TypeTagsHandler

UNKNOWN: type = "block" name = "value" optional = "false" description = "A string containsing the type name."

isOfType

public static boolean isOfType(XClass clazz, String type, int extent)
Returns true if cur_class is of type type. It searches for type in cur_class's hierarchy according to the value of extent parameter.

Parameters: clazz The passed class to compare to the reference type type The reference type extent One of TypeTagsHandler.TYPE_*

Returns: True if there is a match.

See Also: TYPE_HIERARCHY TYPE_CONCRETE_TYPE TYPE_SUPERCLASS

UNKNOWN: move this to xjavadoc

isPrimitiveArray

public static boolean isPrimitiveArray(String name)
Returns true if name is a primitive type and is an array (ends with [])

Parameters: name The name of the type.

Returns: true if name is an array of a primitive type.

See Also: TypeTagsHandler

isPrimitiveType

public static boolean isPrimitiveType(String name)
Returns true if name is a primitive type, in that case name contains the string "int"/"float"/etc.

Parameters: name The passed type to check

Returns: true if this is a primitive type

typeWithoutDimensions

public String typeWithoutDimensions(Properties attributes)
Returns the type specified with the type parameter without dimensions.

Parameters: attributes

Returns:

Throws: XDocletException

UNKNOWN: type = "content" name = "type" optional = "false" description = "Specifies the type to return without * dimensions. So, the value String[][] will be returned as String."