Package org.springframework.data.mapping
Interface PersistentPropertyPathAccessor<T>
- All Superinterfaces:
PersistentPropertyAccessor<T>
- All Known Implementing Classes:
ConvertingPropertyAccessor
Extension of
PersistentPropertyAccessor
that is also able to obtain and set values for
PersistentPropertyPath
s.- Since:
- 2.3
- Author:
- Oliver Drotbohm
-
Method Summary
Modifier and TypeMethodDescriptiondefault Object
getProperty
(PersistentPropertyPath<? extends PersistentProperty<?>> path) Return the value pointed to by the givenPersistentPropertyPath
.getProperty
(PersistentPropertyPath<? extends PersistentProperty<?>> path, AccessOptions.GetOptions context) Return the value pointed to by the givenPersistentPropertyPath
.void
setProperty
(PersistentPropertyPath<? extends PersistentProperty<?>> path, Object value) Sets the given value for thePersistentProperty
pointed to by the givenPersistentPropertyPath
.void
setProperty
(PersistentPropertyPath<? extends PersistentProperty<?>> path, Object value, AccessOptions.SetOptions options) Sets the given value for thePersistentProperty
pointed to by the givenPersistentPropertyPath
considering the givenAccessOptions
.Methods inherited from interface org.springframework.data.mapping.PersistentPropertyAccessor
getBean, getProperty, getProperty, setProperty
-
Method Details
-
getProperty
Return the value pointed to by the givenPersistentPropertyPath
. If the given path is empty, the wrapped bean is returned.- Specified by:
getProperty
in interfacePersistentPropertyAccessor<T>
- Parameters:
path
- must not be null.- Returns:
-
getProperty
@Nullable Object getProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path, AccessOptions.GetOptions context) Return the value pointed to by the givenPersistentPropertyPath
. If the given path is empty, the wrapped bean is returned. On each path segment value lookup, the resulting value is post-processed by handlers registered on the givenTraversalContext
context. This can be used to unwrap container types that are encountered during the traversal.- Parameters:
path
- must not be null.context
- must not be null.- Returns:
-
setProperty
void setProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path, @Nullable Object value) Sets the given value for thePersistentProperty
pointed to by the givenPersistentPropertyPath
. The lookup of intermediate values must not yield null.- Specified by:
setProperty
in interfacePersistentPropertyAccessor<T>
- Parameters:
path
- must not be null or empty.value
- can be null.- See Also:
-
setProperty
void setProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path, @Nullable Object value, AccessOptions.SetOptions options) Sets the given value for thePersistentProperty
pointed to by the givenPersistentPropertyPath
considering the givenAccessOptions
.- Parameters:
path
- must not be null.value
- must not be null.options
- must not be null.
-