com.go.teaservlet
Interface TeaToolsContext.HandyClassInfo

All Known Implementing Classes:
AdminApplication.ContextImpl.HandyClassInfoImpl
Enclosing class:
TeaToolsContext

public static interface TeaToolsContext.HandyClassInfo

provides a bean to contain an assortment of methods to handle class names and properties.


Method Summary
 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.lang.String getDescription()
          Returns the shortDescription or "" if the shortDescription is the same as the displayName.
 java.lang.String getDescriptionFirstSentence()
          Returns the first sentence of the shortDescription.
 java.lang.String getFullName()
          Returns the class name of the specified class.
 MethodDescription[] getMethodDescriptions()
          Returns the type's MethodDescriptions.
 java.lang.String getName()
          Returns the class name of the specified class.
 java.lang.String getPackage()
          Returns the package name of the specified class.
 PropertyDescription[] getPropertyDescriptions()
          Returns the type's PropertyDescriptions.
 java.beans.PropertyDescriptor[] getTeaBeanPropertyDescriptors()
          A function that returns an array of all the available properties on a given class.
 java.beans.MethodDescriptor[] getTeaContextMethodDescriptors()
          Gets the MethodDescriptors of the specified context class including all of the MethodDescriptors for methods declared in the class's superclass and interfaces
 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.
 

Method Detail

getFullName

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

getName

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

getPackage

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

getType

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

getTypeName

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


getArrayType

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

getArrayDimensions

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

getArrayDimensionsString

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

getDescription

public java.lang.String getDescription()
Returns the shortDescription or "" if the shortDescription is the same as the displayName.

getDescriptionFirstSentence

public java.lang.String getDescriptionFirstSentence()
Returns the first sentence of the shortDescription. Returns "" if the shortDescription is the same as the displayName (the default for reflection-generated FeatureDescriptors).

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.

getBeanInfo

public java.beans.BeanInfo getBeanInfo()
Introspects a Java bean to learn about all its properties, exposed methods, and events.
Parameters:
beanClass - the bean class to be analyzed

getMethodDescriptions

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

getPropertyDescriptions

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

getTeaBeanPropertyDescriptors

public java.beans.PropertyDescriptor[] getTeaBeanPropertyDescriptors()
A function that returns an array of all the available properties on a given class.

NOTE: If possible, the results of this method should be cached by the caller.

Parameters:
beanClass - the bean class to introspect
Returns:
an array of all the available properties on the specified class.

getTeaContextMethodDescriptors

public java.beans.MethodDescriptor[] getTeaContextMethodDescriptors()
Gets the MethodDescriptors of the specified context class including all of the MethodDescriptors for methods declared in the class's superclass and interfaces
Parameters:
contextClass - the Tea context Class to introspect (any class will work fine)