Class CombinedPropertyAccessor

java.lang.Object
io.beanmapper.core.inspector.CombinedPropertyAccessor
All Implemented Interfaces:
PropertyAccessor

public class CombinedPropertyAccessor extends Object implements PropertyAccessor
Property accessor that looks at both the getter/setter methods and also at fields.
Since:
Jun 24, 2015
Author:
Jeroen van Schagen
  • Constructor Details

    • CombinedPropertyAccessor

      public CombinedPropertyAccessor(PropertyDescriptor methodAccessor, Field fieldAccessor)
  • Method Details

    • getName

      public String getName()
      Retrieve the property name.
      Specified by:
      getName in interface PropertyAccessor
      Returns:
      property name
    • getType

      public Class<?> getType()
      Retrieve the property type.
      Specified by:
      getType in interface PropertyAccessor
      Returns:
      property type
    • findAnnotation

      public <A extends Annotation> A findAnnotation(Class<A> annotationClass)
      Retrieve the annotation on a property.
      Specified by:
      findAnnotation in interface PropertyAccessor
      Type Parameters:
      A - class type of the annotation class
      Parameters:
      annotationClass - annotation class
      Returns:
      the annotation, if any
    • getValue

      public Object getValue(Object instance)
      Retrieve the property value.
      Specified by:
      getValue in interface PropertyAccessor
      Parameters:
      instance - bean that contains the property
      Returns:
      the property value
    • isReadable

      public boolean isReadable()
      Determine if the property is readable.
      Specified by:
      isReadable in interface PropertyAccessor
      Returns:
      true when readable, else false
    • setValue

      public void setValue(Object instance, Object value)
      Modify the property value.
      Specified by:
      setValue in interface PropertyAccessor
      Parameters:
      instance - bean that contains the property
      value - the new property value
    • isWritable

      public boolean isWritable()
      Determine if the property is writable.
      Specified by:
      isWritable in interface PropertyAccessor
      Returns:
      true when writable, else false
    • getReadMethod

      public Method getReadMethod()
      Specified by:
      getReadMethod in interface PropertyAccessor
    • getWriteMethod

      public Method getWriteMethod()
      Specified by:
      getWriteMethod in interface PropertyAccessor