public class

EnvironmentAccessor

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

Class Overview

Read-only EL property accessor that knows how to retrieve keys of a Spring Environment instance.

Summary

Public Constructors
EnvironmentAccessor()
Public Methods
boolean canRead(EvaluationContext context, Object target, String name)
Can read any Environment, thus always returns true.
boolean canWrite(EvaluationContext context, Object target, String name)
Read only.
Class[]<?> getSpecificTargetClasses()
Return an array of classes for which this resolver should be called.
TypedValue read(EvaluationContext context, Object target, String name)
Access the given target object by resolving the given property name against the given target environment.
void write(EvaluationContext context, Object target, String name, Object newValue)
Read only.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.expression.PropertyAccessor

Public Constructors

public EnvironmentAccessor ()

Public Methods

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

Can read any Environment, thus always 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
Returns
  • true

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

Read only.

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
  • false

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)

Access the given target object by resolving the given property name against the given target environment.

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)

Read only. No-op.

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