spring-context

org.springframework.context.expression
Class EnvironmentAccessor

java.lang.Object
  extended by org.springframework.context.expression.EnvironmentAccessor
All Implemented Interfaces:
org.springframework.expression.PropertyAccessor

public class EnvironmentAccessor
extends java.lang.Object
implements org.springframework.expression.PropertyAccessor

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

Since:
3.1
Author:
Chris Beams

Constructor Summary
EnvironmentAccessor()
           
 
Method Summary
 boolean canRead(org.springframework.expression.EvaluationContext context, java.lang.Object target, java.lang.String name)
          Can read any Environment, thus always returns true.
 boolean canWrite(org.springframework.expression.EvaluationContext context, java.lang.Object target, java.lang.String name)
          Read only.
 java.lang.Class<?>[] getSpecificTargetClasses()
           
 org.springframework.expression.TypedValue read(org.springframework.expression.EvaluationContext context, java.lang.Object target, java.lang.String name)
          Access the given target object by resolving the given property name against the given target environment.
 void write(org.springframework.expression.EvaluationContext context, java.lang.Object target, java.lang.String name, java.lang.Object newValue)
          Read only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnvironmentAccessor

public EnvironmentAccessor()
Method Detail

getSpecificTargetClasses

public java.lang.Class<?>[] getSpecificTargetClasses()
Specified by:
getSpecificTargetClasses in interface org.springframework.expression.PropertyAccessor

canRead

public boolean canRead(org.springframework.expression.EvaluationContext context,
                       java.lang.Object target,
                       java.lang.String name)
                throws org.springframework.expression.AccessException
Can read any Environment, thus always returns true.

Specified by:
canRead in interface org.springframework.expression.PropertyAccessor
Returns:
true
Throws:
org.springframework.expression.AccessException

read

public org.springframework.expression.TypedValue read(org.springframework.expression.EvaluationContext context,
                                                      java.lang.Object target,
                                                      java.lang.String name)
                                               throws org.springframework.expression.AccessException
Access the given target object by resolving the given property name against the given target environment.

Specified by:
read in interface org.springframework.expression.PropertyAccessor
Throws:
org.springframework.expression.AccessException

canWrite

public boolean canWrite(org.springframework.expression.EvaluationContext context,
                        java.lang.Object target,
                        java.lang.String name)
                 throws org.springframework.expression.AccessException
Read only.

Specified by:
canWrite in interface org.springframework.expression.PropertyAccessor
Returns:
false
Throws:
org.springframework.expression.AccessException

write

public void write(org.springframework.expression.EvaluationContext context,
                  java.lang.Object target,
                  java.lang.String name,
                  java.lang.Object newValue)
           throws org.springframework.expression.AccessException
Read only. No-op.

Specified by:
write in interface org.springframework.expression.PropertyAccessor
Throws:
org.springframework.expression.AccessException

spring-context