Top Description Constructors Methods
org.springframework.context.expression

public Class BeanFactoryAccessor

extends Object
implements PropertyAccessor
Class Inheritance
All Implemented Interfaces
org.springframework.expression.PropertyAccessor
Imports
org.springframework.beans.factory.BeanFactory, org.springframework.expression.AccessException, .EvaluationContext, .PropertyAccessor, .TypedValue, org.springframework.lang.Nullable, org.springframework.util.Assert

EL property accessor that knows how to traverse the beans of a Spring org.springframework.beans.factory.BeanFactory.
Authors
Juergen Hoeller, Andy Clement
Since
3.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canRead(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
)

Implements org.springframework.expression.PropertyAccessor.canRead.

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

public boolean
canWrite(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
)

Implements org.springframework.expression.PropertyAccessor.canWrite.

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

public Class<?>[]
getSpecificTargetClasses()

Implements org.springframework.expression.PropertyAccessor.getSpecificTargetClasses.

Return an array of classes for which this resolver should be called.

public TypedValue
read(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
)

Implements org.springframework.expression.PropertyAccessor.read.

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
)

Implements org.springframework.expression.PropertyAccessor.write.

Called to write to a property on a specified target object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BeanFactoryAccessorback to summary
public BeanFactoryAccessor()

Method Detail

canReadback to summary
public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException

Implements org.springframework.expression.PropertyAccessor.canRead.

Doc from org.springframework.expression.PropertyAccessor.canRead.

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

Parameters
context:EvaluationContext

the evaluation context in which the access is being attempted

target:Object

the target object upon which the property is being accessed

name:String

the name of the property being accessed

Returns:boolean

true if this resolver is able to read the property

Annotations
@Override
Exceptions
AccessException:
if there is any problem determining whether the property can be read
canWriteback to summary
public boolean canWrite(EvaluationContext context, Object target, String name) throws AccessException

Implements org.springframework.expression.PropertyAccessor.canWrite.

Doc from org.springframework.expression.PropertyAccessor.canWrite.

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

Parameters
context:EvaluationContext

the evaluation context in which the access is being attempted

target:Object

the target object upon which the property is being accessed

name:String

the name of the property being accessed

Returns:boolean

true if this resolver is able to write to the property

Annotations
@Override
Exceptions
AccessException:
if there is any problem determining whether the property can be written to
getSpecificTargetClassesback to summary
public Class<?>[] getSpecificTargetClasses()

Implements org.springframework.expression.PropertyAccessor.getSpecificTargetClasses.

Doc from org.springframework.expression.PropertyAccessor.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:Class<?>[]

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

Annotations
@Override
readback to summary
public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException

Implements org.springframework.expression.PropertyAccessor.read.

Doc from org.springframework.expression.PropertyAccessor.read.

Called to read a property from a specified target object. Should only succeed if canRead also returns true.

Parameters
context:EvaluationContext

the evaluation context in which the access is being attempted

target:Object

the target object upon which the property is being accessed

name:String

the name of the property being accessed

Returns:TypedValue

a TypedValue object wrapping the property value read and a type descriptor for it

Annotations
@Override
Exceptions
AccessException:
if there is any problem accessing the property value
writeback to summary
public void write(EvaluationContext context, Object target, String name, Object newValue) throws AccessException

Implements org.springframework.expression.PropertyAccessor.write.

Doc from org.springframework.expression.PropertyAccessor.write.

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

Parameters
context:EvaluationContext

the evaluation context in which the access is being attempted

target:Object

the target object upon which the property is being accessed

name:String

the name of the property being accessed

newValue:Object

the new value for the property

Annotations
@Override
Exceptions
AccessException:
if there is any problem writing to the property value