Simple tag support class.
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.
extent_str
- Description of Parameter
- Description of the Returned Value
ifIsNotOfType
public void ifIsNotOfType(String template,
Properties attributes)
throws XDocletException
Evaluate the body block if the entity is not of the specified type.
template
- The body of the block tagattributes
- The attributes of the template tag
ifIsOfType(java.lang.String,java.util.Properties)
- 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)
throws XDocletException
Evaluate the body block if the value is not of a primitive type.
template
- The body of the block tagattributes
- The attributes of the template tag
ifIsPrimitive(java.lang.String,java.util.Properties)
, isPrimitiveType(java.lang.String)
- name = "value"
optional = "false"
description = "A string containsing the type name."
ifIsNotPrimitiveArray
public void ifIsNotPrimitiveArray(String template,
Properties attributes)
throws XDocletException
Evaluate the body block if the value is not of a primitive array type.
template
- The body of the block tagattributes
- The attributes of the template tag
ifIsPrimitiveArray(java.lang.String,java.util.Properties)
, isPrimitiveArray(java.lang.String)
- name = "value"
optional = "false"
description = "A string containsing the type name."
ifIsNotPrimitiveOrString
public void ifIsNotPrimitiveOrString(String template,
Properties attributes)
throws XDocletException
Evaluate the body block if the value is of a primitive type or String.
template
- The body of the block tagattributes
- The attributes of the template tag
ifIsNotPrimitive(java.lang.String,java.util.Properties)
, isPrimitiveType(java.lang.String)
- name = "value"
optional = "false"
description = "A string containsing the type name."
ifIsOfType
public void ifIsOfType(String template,
Properties attributes)
throws XDocletException
Evaluate the body block if the entity is of the specified type.
template
- The body of the block tagattributes
- The attributes of the template tag
ifIsNotOfType(java.lang.String,java.util.Properties)
- 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)
throws XDocletException
Implementation of ifIsOfType
and ifIsNotOfType
tags.
template
- The body of the block tagattributes
- The attributes of the template tagcondition
- Whether to look for a match (true) or non-match (false)
ifIsOfType(java.lang.String,java.util.Properties)
, ifIsNotOfType(java.lang.String,java.util.Properties)
ifIsPrimitive
public void ifIsPrimitive(String template,
Properties attributes)
throws XDocletException
Evaluate the body block if the value is of a primitive type.
template
- The body of the block tagattributes
- The attributes of the template tag
ifIsNotPrimitive(java.lang.String,java.util.Properties)
, isPrimitiveType(java.lang.String)
- name = "value"
optional = "false"
description = "A string containsing the type name."
ifIsPrimitiveArray
public void ifIsPrimitiveArray(String template,
Properties attributes)
throws XDocletException
Evaluate the body block if the value is of a primitive array type.
template
- The body of the block tagattributes
- The attributes of the template tag
ifIsNotPrimitiveArray(java.lang.String,java.util.Properties)
, isPrimitiveArray(java.lang.String)
- name = "value"
optional = "false"
description = "A string containsing the type name."
ifIsPrimitiveOrString
public void ifIsPrimitiveOrString(String template,
Properties attributes)
throws XDocletException
Evaluate the body block if the value is of a primitive type or String.
template
- The body of the block tagattributes
- The attributes of the template tag
ifIsNotPrimitive(java.lang.String,java.util.Properties)
, isPrimitiveType(java.lang.String)
- 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.
clazz
- The passed class to compare to the reference typetype
- The reference typeextent
- One of TypeTagsHandler.TYPE_*
- True if there is a match.
isPrimitiveArray
public static boolean isPrimitiveArray(String name)
Returns true if name is a primitive type and is an array (ends with [])
name
- The name of the type.
- true if name is an array of a primitive type.
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.
name
- The passed type to check
- true if this is a primitive type
typeWithoutDimensions
public String typeWithoutDimensions(Properties attributes)
throws XDocletException
Returns the type specified with the type
parameter without dimensions.
- name = "type"
optional = "false"
description = "Specifies the type to return without
dimensions. So, the value
String[][]
will be returned as String
."