xdoclet.tags
Class TypeTagsHandler

java.lang.Object
  |
  +--xdoclet.template.TemplateTagHandler
        |
        +--xdoclet.XDocletTagSupport
              |
              +--xdoclet.tags.TypeTagsHandler

public class TypeTagsHandler
extends XDocletTagSupport

Simple tag support class.

Version:
$Revision: 1.11 $
Author:
Dmitri Colebatch (dim@bigpond.net.au)

Field Summary
static int TYPE_CONCRETE_TYPE
          Used by isOfType.
static int TYPE_HIERARCHY
          Used by isOfType.
static int TYPE_SUPERCLASS
          Used by isOfType.
 
Fields inherited from class xdoclet.XDocletTagSupport
FOR_CLASS, FOR_CONSTRUCTOR, FOR_FIELD, FOR_METHOD, PARAMETER_DELIMITER
 
Constructor Summary
TypeTagsHandler()
           
 
Method Summary
static int extractExtentType(java.lang.String extent_str)
          Return the integer constact based on the extent_str.
 void ifIsNotOfType(java.lang.String template, java.util.Properties attributes)
          Evaluate the body block if the entity is not of the specified type.
 void ifIsNotPrimitive(java.lang.String template, java.util.Properties attributes)
          Evaluate the body block if the value is not of a primitive type.
 void ifIsNotPrimitiveOrString(java.lang.String template, java.util.Properties attributes)
          Evaluate the body block if the value is of a primitive type or String.
protected  void ifIsOfType_Impl(java.lang.String template, java.util.Properties attributes, boolean condition)
          Implementation of ifIsOfType and ifIsNotOfType tags.
 void ifIsOfType(java.lang.String template, java.util.Properties attributes)
          Evaluate the body block if the entity is of the specified type.
 void ifIsPrimitive(java.lang.String template, java.util.Properties attributes)
          Evaluate the body block if the value is of a primitive type.
 void ifIsPrimitiveOrString(java.lang.String template, java.util.Properties attributes)
          Evaluate the body block if the value is of a primitive type or String.
static boolean isInTypeList(java.lang.String derived_from, java.lang.String class_name)
           
static boolean isOfType(com.sun.javadoc.Type cur_type, java.lang.String type, int extent)
          Returns true if cur_class is of type type.
static boolean isPrimitiveType(java.lang.String name)
          Returns true if name is a primitive type, in that case name contains the string "int"/"float"/etc.
 
Methods inherited from class xdoclet.XDocletTagSupport
getClassTagValue, getClassTagValue, getConstructorTagValue, getCurrentClass, getCurrentConstructor, getCurrentField, getCurrentMethod, getCurrentPackage, getCurrentTag, getDocletContext, getFieldTagValue, getFieldTagValue, getMethodTagValue, getMethodTagValue, getParameterValue, getParameterValue, getTagValue, getTagValue, getTagValue, invalidParamValueFound, mandatoryParamNotFound, mandatoryTemplateTagParamNotFound, parsePropertyString, popCurrentClass, pushCurrentClass, replaceProperties, setCurrentClass, setCurrentConstructor, setCurrentField, setCurrentMethod, setCurrentPackage, setCurrentTag, tokenizeValue
 
Methods inherited from class xdoclet.template.TemplateTagHandler
generate, getContext, getEngine, getParser, setContext, setEngine, setParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_CONCRETE_TYPE

public static final int TYPE_CONCRETE_TYPE
Used by isOfType. isOfType 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 depdening on the context) should be checked for equality.

TYPE_SUPERCLASS

public static final int TYPE_SUPERCLASS
Used by isOfType. isOfType 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 depdening on the context) should be checked for equality, but also direct superclasses and interfaces of the entity.

TYPE_HIERARCHY

public static final int TYPE_HIERARCHY
Used by isOfType. isOfType 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 depdening on the context) should be checked for equality, but also superclasses and interfaces of the entity and recursively superclasses and interfaces.
Constructor Detail

TypeTagsHandler

public TypeTagsHandler()
Method Detail

isPrimitiveType

public static boolean isPrimitiveType(java.lang.String name)
Returns true if name is a primitive type, in that case name contains the string "int"/"float"/etc.
Parameters:
name - Description of Parameter
Returns:
The PrimitiveType value

isOfType

public static boolean isOfType(com.sun.javadoc.Type cur_type,
                               java.lang.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:
extent - Can be one of TYPE_CONCRETE_TYPE, TYPE_SUPERCALASS or TYPE_HIERARCHY
type - Description of Parameter
cur_type - Description of Parameter
Returns:
The OfType value

isInTypeList

public static boolean isInTypeList(java.lang.String derived_from,
                                   java.lang.String class_name)

extractExtentType

public static int extractExtentType(java.lang.String extent_str)
Return the integer constact 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.forAllClasses(java.lang.String,java.util.Properties), ifIsOfType_Impl(java.lang.String,java.util.Properties,boolean), TYPE_HIERARCHY, TYPE_CONCRETE_TYPE, TYPE_SUPERCLASS

ifIsPrimitive

public void ifIsPrimitive(java.lang.String template,
                          java.util.Properties attributes)
                   throws XDocletException
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:
ifIsNotPrimitive(java.lang.String,java.util.Properties), isPrimitiveType(java.lang.String)

ifIsPrimitiveOrString

public void ifIsPrimitiveOrString(java.lang.String template,
                                  java.util.Properties attributes)
                           throws XDocletException
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:
ifIsNotPrimitive(java.lang.String,java.util.Properties), isPrimitiveType(java.lang.String)

ifIsNotPrimitiveOrString

public void ifIsNotPrimitiveOrString(java.lang.String template,
                                     java.util.Properties attributes)
                              throws XDocletException
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:
ifIsNotPrimitive(java.lang.String,java.util.Properties), isPrimitiveType(java.lang.String)

ifIsNotPrimitive

public void ifIsNotPrimitive(java.lang.String template,
                             java.util.Properties attributes)
                      throws XDocletException
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 - Description of Exception
See Also:
ifIsPrimitive(java.lang.String,java.util.Properties), isPrimitiveType(java.lang.String)

ifIsNotOfType

public void ifIsNotOfType(java.lang.String template,
                          java.util.Properties attributes)
                   throws XDocletException
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:
ifIsOfType(java.lang.String,java.util.Properties)

ifIsOfType

public void ifIsOfType(java.lang.String template,
                       java.util.Properties attributes)
                throws XDocletException
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:
ifIsNotOfType(java.lang.String,java.util.Properties)

ifIsOfType_Impl

protected void ifIsOfType_Impl(java.lang.String template,
                               java.util.Properties attributes,
                               boolean condition)
                        throws XDocletException
Implementation of ifIsOfType and ifIsNotOfType tags.
Parameters:
template - The body of the block tag
attributes - The attributes of the template tag
condition - Description of Parameter
Throws:
XDocletException - Description of Exception
See Also:
ifIsOfType(java.lang.String,java.util.Properties), ifIsNotOfType(java.lang.String,java.util.Properties)