com.go.teatools
Class TypeDescription

java.lang.Object
  |
  +--com.go.teatools.FeatureDescription
        |
        +--com.go.teatools.TypeDescription
Direct Known Subclasses:
AdminApplication.ContextImpl.HandyClassInfoImpl

public class TypeDescription
extends FeatureDescription

Object wrapper for TeaToolsUtils functions that operate on Class objects. This class offers an O-O interface alternative to the TeaToolsUtils procedural design.

Version:
3 , 11/13/00
Author:
Mark Masse

Constructor Summary
TypeDescription(java.lang.Class type, TeaToolsUtils utils)
          Create a new TypeDescription to wrap the specified type.
 
Method Summary
 AccessFlags getAccessFlags()
          Returns a AccessFlags instance that can be used to check the type's modifiers.
 int getArrayDimensions()
          Returns the array dimensions.
 java.lang.String getArrayDimensionsString()
          Returns the array dimensions String (i.e.
 TypeDescription getArrayType()
          Returns the array type.
 java.beans.BeanInfo getBeanInfo()
          Introspects a Java bean to learn about all its properties, exposed methods, and events.
 java.beans.BeanInfo getBeanInfo(java.lang.Class stopClass)
          Introspects a Java bean to learn all about its properties, exposed methods, below a given "stop" point.
 java.beans.FeatureDescriptor getFeatureDescriptor()
          Returns the FeatureDescriptor that is wrapped by this FeatureDescription
 java.lang.String getFullName()
          Returns the full name of the type.
 java.lang.String getLongFormat()
          Returns a long format String for this FeatureDescription
 MethodDescription[] getMethodDescriptions()
          Returns the type's MethodDescriptions.
 java.beans.MethodDescriptor[] getMethodDescriptors()
          Returns the type's MethodDescriptors.
 java.lang.String getName()
          Returns the class name of the type.
 java.lang.String getPackage()
          Returns the package name of the class.
 PropertyDescription[] getPropertyDescriptions()
          Returns the type's PropertyDescriptions.
 java.beans.PropertyDescriptor[] getPropertyDescriptors()
          Returns the type's PropertyDescriptors.
 java.lang.String getShortFormat()
          Returns a short format String for this FeatureDescription
 PropertyDescription[] getTeaBeanPropertyDescriptions()
          Returns an array of all the available properties on the class.
 java.beans.PropertyDescriptor[] getTeaBeanPropertyDescriptors()
          Returns an array of all the available properties on the class.
 MethodDescription[] getTeaContextMethodDescriptions()
          Gets the MethodDescriptions of the context class including all of the MethodDescriptions for methods declared in the class's superclass and interfaces
 java.beans.MethodDescriptor[] getTeaContextMethodDescriptors()
          Gets the MethodDescriptors of the context class including all of the MethodDescriptors for methods declared in the class's superclass and interfaces
 java.beans.MethodDescriptor[] getTeaContextMethodDescriptors(boolean thisClassOnly)
          Gets the MethodDescriptors of the context class
 java.lang.String getTeaFullName()
          Returns the full class name of the class.
 java.lang.Class getType()
          Returns the type.
 java.lang.String getTypeName()
          Returns the name of the type of the Class described by this TypeDescription.
 java.lang.String getVersion()
          Create a version information string based on what the build process provided.
 boolean isForeachCompatible()
          Returns true if the class is compatible with Tea's foreach statement.
 boolean isIfCompatible()
          Returns true if the class is compatible with Tea's if statement.
 boolean isImplicitTeaImport()
          Returns true if the class is implicitly imported by Tea.
 boolean isLikelyContextClass()
          Returns true if it is likely that the class serves as a Tea runtime context class.
 
Methods inherited from class com.go.teatools.FeatureDescription
getDescription, getDescriptionFirstSentence, getTeaToolsUtils, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypeDescription

public TypeDescription(java.lang.Class type,
                       TeaToolsUtils utils)
Create a new TypeDescription to wrap the specified type. The TeaToolsUtils object provides the implementation of this class's methods.
Method Detail

getType

public java.lang.Class getType()
Returns the type.

getAccessFlags

public AccessFlags getAccessFlags()
Returns a AccessFlags instance that can be used to check the type's modifiers.

getFullName

public java.lang.String getFullName()
Returns the full name of the type. This method provides special formatting for array and inner classes.

getName

public java.lang.String getName()
Returns the class name of the type. The class name returned does not include the package. This method provides special formatting for array and inner classes.
Overrides:
getName in class FeatureDescription

getPackage

public java.lang.String getPackage()
Returns the package name of the class. Returns "" if the class has no package.

getTypeName

public java.lang.String getTypeName()
Returns the name of the type of the Class described by this TypeDescription.


getVersion

public java.lang.String getVersion()
Create a version information string based on what the build process provided. The string is of the form "M.m.r" or "M.m.r.bbbb" (i.e. 1.1.0.0004) if the build number can be retrieved. Returns null if the version string cannot be retrieved.

getArrayType

public TypeDescription getArrayType()
Returns the array type. Returns this if it is not an array type.

getArrayDimensions

public int getArrayDimensions()
Returns the array dimensions. Returns 0 if the type is not an array.

getArrayDimensionsString

public java.lang.String getArrayDimensionsString()
Returns the array dimensions String (i.e. "[][][]"). Returns "" (empty string) if the type is not an array.

getBeanInfo

public java.beans.BeanInfo getBeanInfo()
Introspects a Java bean to learn about all its properties, exposed methods, and events. Returns null if the BeanInfo could not be created.

getBeanInfo

public java.beans.BeanInfo getBeanInfo(java.lang.Class stopClass)
                                throws java.beans.IntrospectionException
Introspects a Java bean to learn all about its properties, exposed methods, below a given "stop" point.
Parameters:
stopClass - the base class at which to stop the analysis. Any methods/properties/events in the stopClass or in its baseclasses will be ignored in the analysis

getPropertyDescriptors

public java.beans.PropertyDescriptor[] getPropertyDescriptors()
Returns the type's PropertyDescriptors.

getPropertyDescriptions

public PropertyDescription[] getPropertyDescriptions()
Returns the type's PropertyDescriptions.

getTeaBeanPropertyDescriptors

public java.beans.PropertyDescriptor[] getTeaBeanPropertyDescriptors()
Returns an array of all the available properties on the class.

getTeaBeanPropertyDescriptions

public PropertyDescription[] getTeaBeanPropertyDescriptions()
Returns an array of all the available properties on the class.

getMethodDescriptors

public java.beans.MethodDescriptor[] getMethodDescriptors()
Returns the type's MethodDescriptors.

getMethodDescriptions

public MethodDescription[] getMethodDescriptions()
Returns the type's MethodDescriptions.

getTeaContextMethodDescriptors

public java.beans.MethodDescriptor[] getTeaContextMethodDescriptors()
Gets the MethodDescriptors of the context class including all of the MethodDescriptors for methods declared in the class's superclass and interfaces

getTeaContextMethodDescriptions

public MethodDescription[] getTeaContextMethodDescriptions()
Gets the MethodDescriptions of the context class including all of the MethodDescriptions for methods declared in the class's superclass and interfaces

getTeaContextMethodDescriptors

public java.beans.MethodDescriptor[] getTeaContextMethodDescriptors(boolean thisClassOnly)
Gets the MethodDescriptors of the context class
Parameters:
thisClassOnly - true indicates that this function should only return MethodDescriptors declared by the wrapped Class.

getTeaFullName

public java.lang.String getTeaFullName()
Returns the full class name of the class. This method provides special formatting for array and inner classes. If the specified class is implicitly imported by Tea, then its package is omitted in the returned name.

isImplicitTeaImport

public boolean isImplicitTeaImport()
Returns true if the class is implicitly imported by Tea.

Returns true if the specified class represents a primitive type or a class or interface defined in one of the IMPLICIT_TEA_IMPORTS packages. This method also works for array types.


isForeachCompatible

public boolean isForeachCompatible()
Returns true if the class is compatible with Tea's foreach statement. Compatibility implies that the class can be iterated on by the foreach.

isIfCompatible

public boolean isIfCompatible()
Returns true if the class is compatible with Tea's if statement. Only Boolean.class and boolean.class qualify.

isLikelyContextClass

public boolean isLikelyContextClass()
Returns true if it is likely that the class serves as a Tea runtime context class.

getFeatureDescriptor

public java.beans.FeatureDescriptor getFeatureDescriptor()
Description copied from class: FeatureDescription
Returns the FeatureDescriptor that is wrapped by this FeatureDescription
Overrides:
getFeatureDescriptor in class FeatureDescription

getShortFormat

public java.lang.String getShortFormat()
Description copied from class: FeatureDescription
Returns a short format String for this FeatureDescription
Overrides:
getShortFormat in class FeatureDescription

getLongFormat

public java.lang.String getLongFormat()
Description copied from class: FeatureDescription
Returns a long format String for this FeatureDescription
Overrides:
getLongFormat in class FeatureDescription