Top Description Constructors Methods
org.springframework.expression.spel.support

public final Class DataBindingPropertyAccessor

extends ReflectivePropertyAccessor
Class Inheritance
Imports
java.lang.reflect.Method

An org.springframework.expression.PropertyAccessor variant for data binding purposes, using reflection to access properties for reading and possibly writing.

A property can be referenced through a public getter method (when being read) or a public setter method (when being written), and also as a public field.

This accessor is explicitly designed for user-declared properties and does not resolve technical properties on java.lang.Object or java.lang.Class. For unrestricted resolution, choose ReflectivePropertyAccessor instead.

Author
Juergen Hoeller
Since
4.3.15
See Also
forReadOnlyAccess(), forReadWriteAccess(), SimpleEvaluationContext, StandardEvaluationContext, ReflectivePropertyAccessor

Constructor Summary

AccessConstructor and Description
private
DataBindingPropertyAccessor(boolean
whether to also allow for write operations
allowWrite
)

Create a new property accessor for reading and possibly also writing.

Method Summary

Modifier and TypeMethod and Description
public static DataBindingPropertyAccessor
forReadOnlyAccess()

Create a new data-binding property accessor for read-only operations.

public static DataBindingPropertyAccessor
forReadWriteAccess()

Create a new data-binding property accessor for read-write operations.

protected boolean
isCandidateForProperty(Method
the Method to evaluate
method
,
Class<?>
the concrete target class that is being introspected
targetClass
)

Overrides org.springframework.expression.spel.support.ReflectivePropertyAccessor.isCandidateForProperty.

Determine whether the given Method is a candidate for property access on an instance of the given target class.
Inherited from org.springframework.expression.spel.support.ReflectivePropertyAccessor:
canReadcanWritecreateOptimalAccessorfindFieldfindGetterForPropertyfindSetterForPropertygetPropertyMethodSuffixgetPropertyMethodSuffixesgetSpecificTargetClassesreadwrite

Constructor Detail

DataBindingPropertyAccessorback to summary
private DataBindingPropertyAccessor(boolean allowWrite)

Create a new property accessor for reading and possibly also writing.

Parameters
allowWrite:boolean

whether to also allow for write operations

See Also
canWrite

Method Detail

forReadOnlyAccessback to summary
public static DataBindingPropertyAccessor forReadOnlyAccess()

Create a new data-binding property accessor for read-only operations.

forReadWriteAccessback to summary
public static DataBindingPropertyAccessor forReadWriteAccess()

Create a new data-binding property accessor for read-write operations.

isCandidateForPropertyback to summary
protected boolean isCandidateForProperty(Method method, Class<?> targetClass)

Overrides org.springframework.expression.spel.support.ReflectivePropertyAccessor.isCandidateForProperty.

Doc from org.springframework.expression.spel.support.ReflectivePropertyAccessor.isCandidateForProperty.

Determine whether the given Method is a candidate for property access on an instance of the given target class.

The default implementation considers any method as a candidate, even for non-user-declared properties on the Object base class.

Parameters
method:Method

the Method to evaluate

targetClass:Class<?>

the concrete target class that is being introspected

Annotations
@Override