Interface PropertyAccessor

All Known Implementing Classes:
CombinedPropertyAccessor, FieldPropertyAccessor, MethodPropertyAccessor

public interface PropertyAccessor
Abstraction over accessing properties.
Since:
Jun 23, 2015
Author:
Jeroen van Schagen
  • Method Details

    • getName

      String getName()
      Retrieve the property name.
      Returns:
      property name
    • getType

      Class<?> getType()
      Retrieve the property type.
      Returns:
      property type
    • findAnnotation

      <A extends Annotation> A findAnnotation(Class<A> annotationClass)
      Retrieve the annotation on a property.
      Type Parameters:
      A - class type of the annotation class
      Parameters:
      annotationClass - annotation class
      Returns:
      the annotation, if any
    • isReadable

      boolean isReadable()
      Determine if the property is readable.
      Returns:
      true when readable, else false
    • getValue

      Object getValue(Object instance)
      Retrieve the property value.
      Parameters:
      instance - bean that contains the property
      Returns:
      the property value
    • isWritable

      boolean isWritable()
      Determine if the property is writable.
      Returns:
      true when writable, else false
    • setValue

      void setValue(Object instance, Object value)
      Modify the property value.
      Parameters:
      instance - bean that contains the property
      value - the new property value
    • getReadMethod

      Method getReadMethod()
    • getWriteMethod

      Method getWriteMethod()