Class ClassInfo

java.lang.Object
com.ibatis.common.beans.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 Details

    • getClassName

      public String getClassName()
      Gets the name of the class the instance provides information for.
      Returns:
      The class name
    • instantiateClass

      public Object instantiateClass()
      Instantiate class.
      Returns:
      the object
    • getSetter

      public Method getSetter(String propertyName)
      Gets the setter for a property as a Method object.
      Parameters:
      propertyName - - the property
      Returns:
      The Method
    • getGetter

      public Method getGetter(String propertyName)
      Gets the getter for a property as a Method object.
      Parameters:
      propertyName - - the property
      Returns:
      The Method
    • getSetInvoker

      public Invoker getSetInvoker(String propertyName)
      Gets the sets the invoker.
      Parameters:
      propertyName - the property name
      Returns:
      the sets the invoker
    • getGetInvoker

      public Invoker getGetInvoker(String propertyName)
      Gets the gets the invoker.
      Parameters:
      propertyName - the property name
      Returns:
      the gets the invoker
    • 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
    • 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
    • getReadablePropertyNames

      public String[] getReadablePropertyNames()
      Gets an array of the readable properties for an object.
      Returns:
      The array
    • getWriteablePropertyNames

      public String[] getWriteablePropertyNames()
      Gets an array of the writeable properties for an object.
      Returns:
      The array
    • 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
    • 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
    • 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
    • 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
    • setCacheEnabled

      public static void setCacheEnabled(boolean cacheEnabled)
      Sets the cache enabled.
      Parameters:
      cacheEnabled - the new cache enabled
    • 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