public class KeyValueAdaptor
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
KeyValueAdaptor.InvalidAccessorException
Exception thrown to indicate that an accessor cannot be found for the specified target/key pair.
|
class |
KeyValueAdaptor.InvalidSetterException
Exception thrown to indicate that a setter cannot be found for the specified target/key/value group.
|
Constructor and Description |
---|
KeyValueAdaptor()
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
setValueForInvalidSetter(java.lang.Object target,
java.lang.String key,
java.lang.Object value)
Hook to allow subclasses to set a value for an invalid key.
|
void |
setValueForKey(java.lang.Object target,
java.lang.String key,
java.lang.Object value)
Set the target's value for the specified accessor key.
|
void |
setValueForKeyPath(java.lang.Object target,
java.lang.String keyPath,
java.lang.Object value)
Set the target's value for the specified key path.
|
protected java.lang.Object |
valueForInvalidAccessor(java.lang.Object target,
java.lang.String key)
Hook to allow subclasses to provide a value for an invalid key.
|
java.lang.Object |
valueForKey(java.lang.Object target,
java.lang.String key)
Get the target's value for the specified accessor key.
|
java.lang.Object |
valueForKeyPath(java.lang.Object target,
java.lang.String keyPath)
Get the target's value for the specified key path, but return null if any object along the key path is null.
|
public java.lang.Object valueForKey(java.lang.Object target, java.lang.String key)
target
- object from which to get the valuekey
- string indicating an accessor method (or Map key)public java.lang.Object valueForKeyPath(java.lang.Object target, java.lang.String keyPath)
target
- object from which to get the valuekeyPath
- series of keys joined by "." in between.public void setValueForKey(java.lang.Object target, java.lang.String key, java.lang.Object value)
target
- object from which to get the valuekey
- string indicating a setter method (or Map key)value
- the value to setpublic void setValueForKeyPath(java.lang.Object target, java.lang.String keyPath, java.lang.Object value)
target
- object from which to get the valuekeyPath
- series of keys joined by "." in between.value
- the value to setprotected java.lang.Object valueForInvalidAccessor(java.lang.Object target, java.lang.String key)
target
- object from which to get the valuekey
- string indicating the accessor which could not be foundprotected java.lang.Object setValueForInvalidSetter(java.lang.Object target, java.lang.String key, java.lang.Object value)
target
- object from which to get the valuekey
- string indicating the setter which could not be foundvalue
- the value to set