This interface places no restrictions, and so implementors are free to access properties directly as fields or through getters or in any other way they see as appropriate.
A resolver can optionally specify an array of target classes for which it should be
called. However, if it returns null from getSpecificTargetClasses(),
it will be called for all property references and given a chance to determine if it
can read or write them.
Property resolvers are considered to be ordered, and each will be called in turn.
The only rule that affects the call order is that any resolver naming the target
class directly in getSpecificTargetClasses() will be called first, before
the general resolvers.
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if this resolver is able to read the propertythe evaluation context in which the access is being attempted context, Object the target object upon which the property is being accessed target, String the name of the property being accessed name)Called to determine if a resolver instance is able to access a specified property on a specified target object. |
| public boolean | Returns: true if this resolver is able to write to the propertythe evaluation context in which the access is being attempted context, Object the target object upon which the property is being accessed target, String the name of the property being accessed name)Called to determine if a resolver instance is able to write to a specified property on a specified target object. |
| public Class | Returns: an array of classes that this resolver is suitable for (ornull if a general resolver)Return an array of classes for which this resolver should be called. |
| public TypedValue | Returns: a TypedValue object wrapping the property value read and a type descriptor for itthe evaluation context in which the access is being attempted context, Object the target object upon which the property is being accessed target, String the name of the property being accessed name)Called to read a property from a specified target object. |
| public void | write(EvaluationContext
the evaluation context in which the access is being attempted context, Object the target object upon which the property is being accessed target, String the name of the property being accessed name, Object the new value for the property newValue)Called to write to a property on a specified target object. |
| canRead | back to summary |
|---|---|
| public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException Called to determine if a resolver instance is able to access a specified property on a specified target object.
| |
| canWrite | back to summary |
|---|---|
| public boolean canWrite(EvaluationContext context, Object target, String name) throws AccessException Called to determine if a resolver instance is able to write to a specified property on a specified target object.
| |
| getSpecificTargetClasses | back to summary |
|---|---|
| public Class Return an array of classes for which this resolver should be called. Returning | |
| read | back to summary |
|---|---|
| public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException Called to read a property from a specified target object.
Should only succeed if
| |
| write | back to summary |
|---|---|
| public void write(EvaluationContext context, Object target, String name, Object newValue) throws AccessException Called to write to a property on a specified target object.
Should only succeed if
| |