Class EnvironmentAccessor
java.lang.Object
org.springframework.context.expression.EnvironmentAccessor
- All Implemented Interfaces:
org.springframework.expression.PropertyAccessor
public class EnvironmentAccessor
extends 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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Can read anyEnvironment
, thus always returns true.boolean
Read-only: returnsfalse
.Class<?>[]
org.springframework.expression.TypedValue
Access the given target object by resolving the given property name against the given target environment.void
write
(org.springframework.expression.EvaluationContext context, Object target, String name, Object newValue) Read-only: no-op.
-
Constructor Details
-
EnvironmentAccessor
public EnvironmentAccessor()
-
-
Method Details
-
getSpecificTargetClasses
- Specified by:
getSpecificTargetClasses
in interfaceorg.springframework.expression.PropertyAccessor
-
canRead
public boolean canRead(org.springframework.expression.EvaluationContext context, @Nullable Object target, String name) throws org.springframework.expression.AccessException Can read anyEnvironment
, thus always returns true.- Specified by:
canRead
in interfaceorg.springframework.expression.PropertyAccessor
- Returns:
- true
- Throws:
org.springframework.expression.AccessException
-
read
public org.springframework.expression.TypedValue read(org.springframework.expression.EvaluationContext context, @Nullable Object target, 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 interfaceorg.springframework.expression.PropertyAccessor
- Throws:
org.springframework.expression.AccessException
-
canWrite
public boolean canWrite(org.springframework.expression.EvaluationContext context, @Nullable Object target, String name) throws org.springframework.expression.AccessException Read-only: returnsfalse
.- Specified by:
canWrite
in interfaceorg.springframework.expression.PropertyAccessor
- Throws:
org.springframework.expression.AccessException
-
write
public void write(org.springframework.expression.EvaluationContext context, @Nullable Object target, String name, @Nullable Object newValue) throws org.springframework.expression.AccessException Read-only: no-op.- Specified by:
write
in interfaceorg.springframework.expression.PropertyAccessor
- Throws:
org.springframework.expression.AccessException
-