com.ibatis.common.beans

Class ClassInfo

public class ClassInfo extends Object

This class represents a cached set of class definition information that allows for easy mapping between property names and getter/setter methods.
Method Summary
StringgetClassName()
Gets the name of the class the instance provides information for
InvokergetGetInvoker(String propertyName)
MethodgetGetter(String propertyName)
Gets the getter for a property as a Method object
ClassgetGetterType(String propertyName)
Gets the type for a property getter
static ClassInfogetInstance(Class clazz)
Gets an instance of ClassInfo for the specified class.
String[]getReadablePropertyNames()
Gets an array of the readable properties for an object
InvokergetSetInvoker(String propertyName)
MethodgetSetter(String propertyName)
Gets the setter for a property as a Method object
ClassgetSetterType(String propertyName)
Gets the type for a property setter
String[]getWriteablePropertyNames()
Gets an array of the writeable properties for an object
booleanhasReadableProperty(String propertyName)
Check to see if a class has a readable property by name
booleanhasWritableProperty(String propertyName)
Check to see if a class has a writeable property by name
ObjectinstantiateClass()
static booleanisKnownType(Class clazz)
Tells us if the class passed in is a knwon common type
static voidsetCacheEnabled(boolean cacheEnabled)
static ThrowableunwrapThrowable(Throwable t)
Examines a Throwable object and gets it's root cause

Method Detail

getClassName

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

Returns: The class name

getGetInvoker

public Invoker getGetInvoker(String propertyName)

getGetter

public Method getGetter(String propertyName)
Gets the getter for a property as a Method object

Parameters: propertyName - the property

Returns: The Method

getGetterType

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

Parameters: propertyName - the name of the property

Returns: The Class of the propery getter

getInstance

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

Parameters: clazz The class for which to lookup the method cache.

Returns: The method cache for the class

getReadablePropertyNames

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

Returns: The array

getSetInvoker

public Invoker getSetInvoker(String propertyName)

getSetter

public Method getSetter(String propertyName)
Gets the setter for a property as a Method object

Parameters: propertyName - the property

Returns: The Method

getSetterType

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

Parameters: propertyName - the name of the property

Returns: The Class of the propery setter

getWriteablePropertyNames

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

Returns: The array

hasReadableProperty

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

Parameters: propertyName - the name of the property to check

Returns: True if the object has a readable property by the name

hasWritableProperty

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

Parameters: propertyName - the name of the property to check

Returns: True if the object has a writeable property by the name

instantiateClass

public Object instantiateClass()

isKnownType

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

Parameters: clazz The class to check

Returns: True if the class is known

setCacheEnabled

public static void setCacheEnabled(boolean cacheEnabled)

unwrapThrowable

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

Parameters: t - the exception to examine

Returns: The root cause

Copyright © 2011. All Rights Reserved.