Package io.beanmapper.core.inspector
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 Summary
Modifier and TypeMethodDescription<A extends Annotation>
AfindAnnotation(Class<A> annotationClass)
Retrieve the annotation on a property.getName()
Retrieve the property name.Class<?>
getType()
Retrieve the property type.Retrieve the property value.boolean
Determine if the property is readable.boolean
Determine if the property is writable.void
Modify the property value.
-
Method Details
-
getName
String getName()Retrieve the property name.- Returns:
- property name
-
getType
Class<?> getType()Retrieve the property type.- Returns:
- property type
-
findAnnotation
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, elsefalse
-
getValue
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, elsefalse
-
setValue
Modify the property value.- Parameters:
instance
- bean that contains the propertyvalue
- the new property value
-
getReadMethod
Method getReadMethod() -
getWriteMethod
Method getWriteMethod()
-