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
PersistentPropertyPaths.- Since:
- 2.3
- Author:
- Oliver Drotbohm
-
Method Summary
Modifier and TypeMethodDescriptiondefault ObjectgetProperty(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.voidsetProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path, Object value) Sets the given value for thePersistentPropertypointed to by the givenPersistentPropertyPath.voidsetProperty(PersistentPropertyPath<? extends PersistentProperty<?>> path, Object value, AccessOptions.SetOptions options) Sets the given value for thePersistentPropertypointed to by the givenPersistentPropertyPathconsidering 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:
getPropertyin 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 givenTraversalContextcontext. 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 thePersistentPropertypointed to by the givenPersistentPropertyPath. The lookup of intermediate values must not yield null.- Specified by:
setPropertyin 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 thePersistentPropertypointed to by the givenPersistentPropertyPathconsidering the givenAccessOptions.- Parameters:
path- must not be null.value- must not be null.options- must not be null.
-