Class DataBindingPropertyAccessor
- All Implemented Interfaces:
PropertyAccessor, TargetedAccessor
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.
WARNING: Configuring this accessor for read-only access —
for example, via forReadOnlyAccess() or
SimpleEvaluationContext.forReadOnlyDataBinding() — disallows
assignment to a property but does not verify that reading a property is
free of side effects. See the
Security Considerations section of the Spring Framework reference
documentation, as well as the class-level documentation for
ReflectivePropertyAccessor, for details.
- Since:
- 4.3.15
- Author:
- Juergen Hoeller
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic DataBindingPropertyAccessorCreate a new data-binding property accessor for read-only operations.static DataBindingPropertyAccessorCreate a new data-binding property accessor for read-write operations.protected booleanisCandidateForProperty(Method method, Class<?> targetClass) Determine whether the givenMethodis a candidate for property access on an instance of the given target class.Methods inherited from class ReflectivePropertyAccessor
canRead, canWrite, createOptimalAccessor, findField, findGetterForProperty, findSetterForProperty, getPropertyMethodSuffix, getPropertyMethodSuffixes, getSpecificTargetClasses, read, write
-
Method Details
-
isCandidateForProperty
Description copied from class:ReflectivePropertyAccessorDetermine whether the givenMethodis 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
Objectbase class.- Overrides:
isCandidateForPropertyin classReflectivePropertyAccessor- Parameters:
method- the Method to evaluatetargetClass- the concrete target class that is being introspected
-
forReadOnlyAccess
Create a new data-binding property accessor for read-only operations. -
forReadWriteAccess
Create a new data-binding property accessor for read-write operations.
-