Class ComplexBeanProbe

java.lang.Object
com.ibatis.common.beans.BaseProbe
com.ibatis.common.beans.ComplexBeanProbe
All Implemented Interfaces:
Probe

public class ComplexBeanProbe extends BaseProbe
StaticBeanProbe provides methods that allow simple, reflective access to JavaBeans style properties. Methods are provided for all simple types as well as object types.

Examples:

StaticBeanProbe.setObject(object, propertyName, value);

Object value = StaticBeanProbe.getObject(object, propertyName);

  • Constructor Details

    • ComplexBeanProbe

      protected ComplexBeanProbe()
      Instantiates a new complex bean probe.
  • Method Details

    • getReadablePropertyNames

      public String[] getReadablePropertyNames(Object object)
      Returns an array of the readable properties exposed by a bean
      Specified by:
      getReadablePropertyNames in class BaseProbe
      Parameters:
      object - The bean
      Returns:
      The properties
    • getWriteablePropertyNames

      public String[] getWriteablePropertyNames(Object object)
      Returns an array of the writeable properties exposed by a bean
      Specified by:
      getWriteablePropertyNames in class BaseProbe
      Parameters:
      object - The bean
      Returns:
      The properties
    • getPropertyTypeForSetter

      public Class getPropertyTypeForSetter(Object object, String name)
      Returns the class that the setter expects to receive as a parameter when setting a property value.
      Parameters:
      object - The bean to check
      name - The name of the property
      Returns:
      The type of the property
    • getPropertyTypeForGetter

      public Class getPropertyTypeForGetter(Object object, String name)
      Returns the class that the getter will return when reading a property value.
      Parameters:
      object - The bean to check
      name - The name of the property
      Returns:
      The type of the property
    • getObject

      public Object getObject(Object object, String name)
      Gets an Object property from a bean
      Parameters:
      object - The bean
      name - The property name
      Returns:
      The property value (as an Object)
    • setObject

      public void setObject(Object object, String name, Object value)
      Sets the value of a bean property to an Object
      Parameters:
      object - The bean to change
      name - The name of the property to set
      value - The new value to set
    • hasWritableProperty

      public boolean hasWritableProperty(Object object, String propertyName)
      Checks to see if a bean has a writable property be a given name
      Parameters:
      object - The bean to check
      propertyName - The property to check for
      Returns:
      True if the property exists and is writable
    • hasReadableProperty

      public boolean hasReadableProperty(Object object, String propertyName)
      Checks to see if a bean has a readable property be a given name
      Parameters:
      object - The bean to check
      propertyName - The property to check for
      Returns:
      True if the property exists and is readable
    • getProperty

      protected Object getProperty(Object object, String name)
      Description copied from class: BaseProbe
      Gets the property.
      Specified by:
      getProperty in class BaseProbe
      Parameters:
      object - the object
      name - the property
      Returns:
      the property
    • setProperty

      protected void setProperty(Object object, String name, Object value)
      Description copied from class: BaseProbe
      Sets the property.
      Specified by:
      setProperty in class BaseProbe
      Parameters:
      object - the object
      name - the property
      value - the value