com.ibatis.common.beans
Class ClassInfo

java.lang.Object
  extended by com.ibatis.common.beans.ClassInfo

public class ClassInfo
extends java.lang.Object

This class represents a cached set of class definition information that allows for easy mapping between property names and getter/setter methods.


方法摘要
 java.lang.String getClassName()
          Gets the name of the class the instance provides information for
 Invoker getGetInvoker(java.lang.String propertyName)
           
 java.lang.reflect.Method getGetter(java.lang.String propertyName)
          Gets the getter for a property as a Method object
 java.lang.Class getGetterType(java.lang.String propertyName)
          Gets the type for a property getter
static ClassInfo getInstance(java.lang.Class clazz)
          Gets an instance of ClassInfo for the specified class.
 java.lang.String[] getReadablePropertyNames()
          Gets an array of the readable properties for an object
 Invoker getSetInvoker(java.lang.String propertyName)
           
 java.lang.reflect.Method getSetter(java.lang.String propertyName)
          Gets the setter for a property as a Method object
 java.lang.Class getSetterType(java.lang.String propertyName)
          Gets the type for a property setter
 java.lang.String[] getWriteablePropertyNames()
          Gets an array of the writeable properties for an object
 boolean hasReadableProperty(java.lang.String propertyName)
          Check to see if a class has a readable property by name
 boolean hasWritableProperty(java.lang.String propertyName)
          Check to see if a class has a writeable property by name
 java.lang.Object instantiateClass()
           
static boolean isKnownType(java.lang.Class clazz)
          Tells us if the class passed in is a knwon common type
static void setCacheEnabled(boolean cacheEnabled)
           
static java.lang.Throwable unwrapThrowable(java.lang.Throwable t)
          Examines a Throwable object and gets it's root cause
 
类方法继承: java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

方法详细信息

getClassName

public java.lang.String getClassName()
Gets the name of the class the instance provides information for

返回:
The class name

instantiateClass

public java.lang.Object instantiateClass()

getSetter

public java.lang.reflect.Method getSetter(java.lang.String propertyName)
Gets the setter for a property as a Method object

参数:
propertyName - - the property
返回:
The Method

getGetter

public java.lang.reflect.Method getGetter(java.lang.String propertyName)
Gets the getter for a property as a Method object

参数:
propertyName - - the property
返回:
The Method

getSetInvoker

public Invoker getSetInvoker(java.lang.String propertyName)

getGetInvoker

public Invoker getGetInvoker(java.lang.String propertyName)

getSetterType

public java.lang.Class getSetterType(java.lang.String propertyName)
Gets the type for a property setter

参数:
propertyName - - the name of the property
返回:
The Class of the propery setter

getGetterType

public java.lang.Class getGetterType(java.lang.String propertyName)
Gets the type for a property getter

参数:
propertyName - - the name of the property
返回:
The Class of the propery getter

getReadablePropertyNames

public java.lang.String[] getReadablePropertyNames()
Gets an array of the readable properties for an object

返回:
The array

getWriteablePropertyNames

public java.lang.String[] getWriteablePropertyNames()
Gets an array of the writeable properties for an object

返回:
The array

hasWritableProperty

public boolean hasWritableProperty(java.lang.String propertyName)
Check to see if a class has a writeable property by name

参数:
propertyName - - the name of the property to check
返回:
True if the object has a writeable property by the name

hasReadableProperty

public boolean hasReadableProperty(java.lang.String propertyName)
Check to see if a class has a readable property by name

参数:
propertyName - - the name of the property to check
返回:
True if the object has a readable property by the name

isKnownType

public static boolean isKnownType(java.lang.Class clazz)
Tells us if the class passed in is a knwon common type

参数:
clazz - The class to check
返回:
True if the class is known

getInstance

public static ClassInfo getInstance(java.lang.Class clazz)
Gets an instance of ClassInfo for the specified class.

参数:
clazz - The class for which to lookup the method cache.
返回:
The method cache for the class

setCacheEnabled

public static void setCacheEnabled(boolean cacheEnabled)

unwrapThrowable

public static java.lang.Throwable unwrapThrowable(java.lang.Throwable t)
Examines a Throwable object and gets it's root cause

参数:
t - - the exception to examine
返回:
The root cause