interface PropertyAccessor
Common interface for classes that can access named properties (such as bean properties of an object or fields in an object) Serves as base interface for BeanWrapper.
Author
Juergen Hoeller
Since
1.1
See Also
BeanWrapperPropertyAccessorFactory#forBeanPropertyAccessPropertyAccessorFactory#forDirectFieldAccess
static val NESTED_PROPERTY_SEPARATOR: String
Path separator for nested properties. Follows normal Java conventions: getFoo().getBar() would be "foo.bar". |
|
static val NESTED_PROPERTY_SEPARATOR_CHAR: Char |
|
static val PROPERTY_KEY_PREFIX: String
Marker that indicates the start of a property key for an indexed or mapped property like "person.addresses[0]". |
|
static val PROPERTY_KEY_PREFIX_CHAR: Char |
|
static val PROPERTY_KEY_SUFFIX: String
Marker that indicates the end of a property key for an indexed or mapped property like "person.addresses[0]". |
|
static val PROPERTY_KEY_SUFFIX_CHAR: Char |
abstract fun getPropertyType(propertyName: String): Class<*>
Determine the property type for the specified property, either checking the property descriptor or checking the value in case of an indexed or mapped element. |
|
abstract fun getPropertyTypeDescriptor(propertyName: String): TypeDescriptor
Return a type descriptor for the specified property: preferably from the read method, falling back to the write method. |
|
abstract fun getPropertyValue(propertyName: String): Any
Get the current value of the specified property. |
|
abstract fun isReadableProperty(propertyName: String): Boolean
Determine whether the specified property is readable. Returns |
|
abstract fun isWritableProperty(propertyName: String): Boolean
Determine whether the specified property is writable. Returns |
|
abstract fun setPropertyValue(propertyName: String, value: Any): Unitabstract fun setPropertyValue(pv: PropertyValue): Unit
Set the specified value as current property value. |
|
abstract fun setPropertyValues(map: MutableMap<*, *>): Unit
Perform a batch update from a Map. Bulk updates from PropertyValues are more powerful: This method is provided for convenience. Behavior will be identical to that of the abstract fun setPropertyValues(pvs: PropertyValues): Unit
The preferred way to perform a batch update. Note that performing a batch update differs from performing a single update, in that an implementation of this class will continue to update properties if a recoverable error (such as a type mismatch, but not an invalid field name or the like) is encountered, throwing a PropertyBatchUpdateException containing all the individual errors. This exception can be examined later to see all binding errors. Properties that were successfully updated remain changed. Does not allow unknown fields or invalid fields. abstract fun setPropertyValues(pvs: PropertyValues, ignoreUnknown: Boolean): Unit
Perform a batch update with more control over behavior. Note that performing a batch update differs from performing a single update, in that an implementation of this class will continue to update properties if a recoverable error (such as a type mismatch, but not an invalid field name or the like) is encountered, throwing a PropertyBatchUpdateException containing all the individual errors. This exception can be examined later to see all binding errors. Properties that were successfully updated remain changed. abstract fun setPropertyValues(pvs: PropertyValues, ignoreUnknown: Boolean, ignoreInvalid: Boolean): Unit
Perform a batch update with full control over behavior. Note that performing a batch update differs from performing a single update, in that an implementation of this class will continue to update properties if a recoverable error (such as a type mismatch, but not an invalid field name or the like) is encountered, throwing a PropertyBatchUpdateException containing all the individual errors. This exception can be examined later to see all binding errors. Properties that were successfully updated remain changed. |