Interface PropertyValueProvider
Interface that can be implemented to provide access to field values based on their name. Usually implemented with PlasticUtils.implementPropertyValueProvider(PlasticClass, java.util.Set).
The name of its abstract method is intended to avoid clashes with other existing methods in the class.
- Since:
- 5.8.4
- See Also:
-
Method Summary
Modifier and TypeMethodDescription__propertyValueProvider__get
(String fieldName) Returns the value of a given field.void
__propertyValueProvider__set
(String fieldName, Object value) Sets the value of a given field.static Object
Returns the value of a given field in a given object if it belongs to a class that implements PropertyValueProvider.static void
Sets the value of a given field in a given object if it belongs to a class that implements PropertyValueProvider.
-
Method Details
-
__propertyValueProvider__get
Returns the value of a given field.- Parameters:
fieldName
- the field name.- Returns:
- the field value.
-
__propertyValueProvider__set
Sets the value of a given field.- Parameters:
fieldName
- the field name.value
- the field value.- Since:
- 5.8.7
-
get
Returns the value of a given field in a given object if it belongs to a class that implements PropertyValueProvider. Otherwise, it throws an exception.
This is an utility method to avoid having to make casts very time you need to call __propertyValueProvider__get(String).
- Parameters:
object
- an object.fieldName
- the field name.- Returns:
- the field value.
-
set
Sets the value of a given field in a given object if it belongs to a class that implements PropertyValueProvider. Otherwise, it throws an exception.
This is an utility method to avoid having to make casts very time you need to call __propertyValueProvider__set(String, Object).
- Parameters:
object
- an object.fieldName
- the field name.value
- the field value.- Since:
- 5.8.7
-