POJO - is the generic type of the Pojo to access.VALUE - is the generic type of the POJOs property to access.public class PojoPathPropertyAccessor<POJO,VALUE> extends Object implements PropertyAccessor<POJO,VALUE>, AttributeReadValueType<VALUE>
PropertyAccessor using PojoPathNavigator (based on reflection).| Modifier and Type | Field and Description |
|---|---|
private PojoPathContext |
context
The
PojoPathContext to use. |
private PojoPathNavigator |
navigator
The
PojoPathNavigator instance to use. |
private String |
pojoPath
The
PojoPath pointing to the according property to access. |
private Class<VALUE> |
valueType |
private PojoPathMode |
writeMode
The
PojoPathMode used for write access. |
| Constructor and Description |
|---|
PojoPathPropertyAccessor(PojoPathNavigator navigator,
String pojoPath,
Class<VALUE> valueType)
The constructor.
|
PojoPathPropertyAccessor(PojoPathNavigator navigator,
String pojoPath,
Class<VALUE> valueType,
PojoPathMode writeMode)
The constructor.
|
PojoPathPropertyAccessor(PojoPathNavigator navigator,
String pojoPath,
Class<VALUE> valueType,
PojoPathMode writeMode,
PojoPathContext context)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
VALUE |
getValue(POJO element)
This method gets the value of the property represented by this
PropertyAccessor from the given
element. |
Class<VALUE> |
getValueType()
This method gets the value type of this object.
|
void |
setValue(POJO element,
VALUE value)
This method sets the value of the property represented by this
PropertyAccessor in the given
element. |
private final PojoPathNavigator navigator
PojoPathNavigator instance to use.private final PojoPathMode writeMode
PojoPathMode used for write access.private final PojoPathContext context
PojoPathContext to use.public PojoPathPropertyAccessor(PojoPathNavigator navigator, String pojoPath, Class<VALUE> valueType)
navigator - is the PojoPathNavigator instance to use.pojoPath - is the PojoPath pointing to the according property to access.valueType - is the value type.public PojoPathPropertyAccessor(PojoPathNavigator navigator, String pojoPath, Class<VALUE> valueType, PojoPathMode writeMode)
navigator - is the PojoPathNavigator instance to use.pojoPath - is the PojoPath pointing to the according property to access.valueType - is the value type.writeMode - is the PojoPathMode used for write access. For
read-access always PojoPathMode.RETURN_IF_NULL is used.public PojoPathPropertyAccessor(PojoPathNavigator navigator, String pojoPath, Class<VALUE> valueType, PojoPathMode writeMode, PojoPathContext context)
navigator - is the PojoPathNavigator instance to use.pojoPath - is the PojoPath pointing to the according property to access.valueType - is the value type.writeMode - is the PojoPathMode used for write access. For
read-access always PojoPathMode.RETURN_IF_NULL is used.context - is the PojoPathContext to use.public Class<VALUE> getValueType()
AttributeReadValueTypeAttributeReadValue.getValue().getValueType in interface AttributeReadValueType<VALUE>public VALUE getValue(POJO element)
PropertyAccessorPropertyAccessor from the given
element.getValue in interface PropertyAccessor<POJO,VALUE>element - is the element where to get the value from.element.public void setValue(POJO element, VALUE value)
PropertyAccessorPropertyAccessor in the given
element.setValue in interface PropertyAccessor<POJO,VALUE>element - is the element where to set the value.value - is the new value for the property.Copyright © 2001–2016 mmm-Team. All rights reserved.