public class

MapAccessor

extends Object
implements PropertyAccessor
java.lang.Object
   ↳ org.springframework.context.expression.MapAccessor

Class Overview

EL property accessor that knows how to traverse the keys of a standard java.util.Map.

Summary

Public Constructors
MapAccessor()
Public Methods
boolean canRead(EvaluationContext context, Object target, String name)
Called to determine if a resolver instance is able to access a specified property on a specified target object.
boolean canWrite(EvaluationContext context, Object target, String name)
Called to determine if a resolver instance is able to write to a specified property on a specified target object.
Class[] getSpecificTargetClasses()
Return an array of classes for which this resolver should be called.
TypedValue read(EvaluationContext context, Object target, String name)
Called to read a property from a specified target object
void write(EvaluationContext context, Object target, String name, Object newValue)
Called to write to a property on a specified target object.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.expression.PropertyAccessor

Public Constructors

public MapAccessor ()

Public Methods

public boolean canRead (EvaluationContext context, Object target, String name)

Called to determine if a resolver instance is able to access a specified property on a specified target object.

Parameters
context the evaluation context in which the access is being attempted
target the target object upon which the property is being accessed
name the name of the property being accessed
Returns
  • true if this resolver is able to read the property

public boolean canWrite (EvaluationContext context, Object target, String name)

Called to determine if a resolver instance is able to write to a specified property on a specified target object.

Parameters
context the evaluation context in which the access is being attempted
target the target object upon which the property is being accessed
name the name of the property being accessed
Returns
  • true if this resolver is able to write to the property

public Class[] getSpecificTargetClasses ()

Return an array of classes for which this resolver should be called. Returning null indicates this is a general resolver that can be called in an attempt to resolve a property on any type.

Returns
  • an array of classes that this resolver is suitable for (or null if a general resolver)

public TypedValue read (EvaluationContext context, Object target, String name)

Called to read a property from a specified target object

Parameters
context the evaluation context in which the access is being attempted
target the target object upon which the property is being accessed
name the name of the property being accessed
Returns
  • a TypedValue object wrapping the property value read and a type descriptor for it

public void write (EvaluationContext context, Object target, String name, Object newValue)

Called to write to a property on a specified target object. Should only succeed if canWrite() also returns true.

Parameters
context the evaluation context in which the access is being attempted
target the target object upon which the property is being accessed
name the name of the property being accessed
newValue the new value for the property