Package com.ibatis.common.beans
Class ClassInfo
java.lang.Object
com.ibatis.common.beans.ClassInfo
This class represents a cached set of class definition information that allows for easy mapping between property
names and getter/setter methods.
-
Method Summary
Modifier and TypeMethodDescriptionGets the name of the class the instance provides information for.getGetInvoker
(String propertyName) Gets the gets the invoker.Gets the getter for a property as a Method object.getGetterType
(String propertyName) Gets the type for a property getter.static ClassInfo
getInstance
(Class clazz) Gets an instance of ClassInfo for the specified class.String[]
Gets an array of the readable properties for an object.getSetInvoker
(String propertyName) Gets the sets the invoker.Gets the setter for a property as a Method object.getSetterType
(String propertyName) Gets the type for a property setter.String[]
Gets an array of the writeable properties for an object.boolean
hasReadableProperty
(String propertyName) Check to see if a class has a readable property by name.boolean
hasWritableProperty
(String propertyName) Check to see if a class has a writeable property by name.Instantiate class.static boolean
isKnownType
(Class clazz) Tells us if the class passed in is a knwon common type.static void
setCacheEnabled
(boolean cacheEnabled) Sets the cache enabled.static Throwable
Examines a Throwable object and gets it's root cause.
-
Method Details
-
getClassName
Gets the name of the class the instance provides information for.- Returns:
- The class name
-
instantiateClass
Instantiate class.- Returns:
- the object
-
getSetter
Gets the setter for a property as a Method object.- Parameters:
propertyName
- - the property- Returns:
- The Method
-
getGetter
Gets the getter for a property as a Method object.- Parameters:
propertyName
- - the property- Returns:
- The Method
-
getSetInvoker
Gets the sets the invoker.- Parameters:
propertyName
- the property name- Returns:
- the sets the invoker
-
getGetInvoker
Gets the gets the invoker.- Parameters:
propertyName
- the property name- Returns:
- the gets the invoker
-
getSetterType
Gets the type for a property setter.- Parameters:
propertyName
- - the name of the property- Returns:
- The Class of the propery setter
-
getGetterType
Gets the type for a property getter.- Parameters:
propertyName
- - the name of the property- Returns:
- The Class of the propery getter
-
getReadablePropertyNames
Gets an array of the readable properties for an object.- Returns:
- The array
-
getWriteablePropertyNames
Gets an array of the writeable properties for an object.- Returns:
- The array
-
hasWritableProperty
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
-
hasReadableProperty
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
-
isKnownType
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
-
getInstance
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
-
setCacheEnabled
public static void setCacheEnabled(boolean cacheEnabled) Sets the cache enabled.- Parameters:
cacheEnabled
- the new cache enabled
-
unwrapThrowable
Examines a Throwable object and gets it's root cause.- Parameters:
t
- - the exception to examine- Returns:
- The root cause
-