public class GenericDynamicProperty extends AbstractDynamicProperty
Constructor and Description |
---|
GenericDynamicProperty(java.lang.String propertyName,
java.lang.Class<?> type,
boolean readOnly) |
GenericDynamicProperty(java.lang.String propertyName,
java.lang.Class<?> type,
FunctionCallback initialValueGenerator,
boolean readOnly)
Variant that allows supply of a lazy-initialization function for the initial value.
|
GenericDynamicProperty(java.lang.String propertyName,
java.lang.Class<?> type,
java.lang.Object initialValue,
boolean readOnly) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
get(java.lang.Object object)
Call the getter on the given object
|
void |
set(java.lang.Object object,
java.lang.Object newValue)
Call the setter on the given object
|
getPropertyName, isPropertyMatch
public GenericDynamicProperty(java.lang.String propertyName, java.lang.Class<?> type, java.lang.Object initialValue, boolean readOnly)
propertyName
- The name of the propertytype
- The type of the propertyinitialValue
- The initial value of the propertyreadOnly
- True for read-only propertypublic GenericDynamicProperty(java.lang.String propertyName, java.lang.Class<?> type, boolean readOnly)
propertyName
- The name of the propertytype
- The type of the propertyreadOnly
- True for read-only propertypublic GenericDynamicProperty(java.lang.String propertyName, java.lang.Class<?> type, FunctionCallback initialValueGenerator, boolean readOnly)
Variant that allows supply of a lazy-initialization function for the initial value.
This function is called only on the first access to the property for a given object, unless the function returns null in which case it will be called again if another request is made.
propertyName
- The name of the propertytype
- The type of the propertyreadOnly
- True for read-only propertypublic java.lang.Object get(java.lang.Object object)
DynamicProperty
get
in interface DynamicProperty
get
in class AbstractDynamicProperty
object
- The target objectpublic void set(java.lang.Object object, java.lang.Object newValue)
DynamicProperty
set
in interface DynamicProperty
set
in class AbstractDynamicProperty
object
- The target objectnewValue
- The new value of the property