public class InstantiationAwarePropertyAccessor<T> extends Object implements PersistentPropertyAccessor<T>
PersistentPropertyAccessor
that will use an entity's PersistenceConstructor
to create a new
instance of it to apply a new value for a given PersistentProperty
. Will only be used if the
PersistentProperty
is to be applied on a completely immutable entity type exposing a persistence constructor.Constructor and Description |
---|
InstantiationAwarePropertyAccessor(PersistentPropertyAccessor<T> delegate,
EntityInstantiators instantiators)
Creates an
InstantiationAwarePropertyAccessor using the given delegate PersistentPropertyAccessor
and EntityInstantiators . |
Modifier and Type | Method and Description |
---|---|
T |
getBean()
Returns the underlying bean.
|
Object |
getProperty(PersistentProperty<?> property)
Returns the value of the given
PersistentProperty of the underlying bean instance. |
void |
setProperty(PersistentProperty<?> property,
Object value)
Sets the given
PersistentProperty to the given value. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getProperty, getProperty, setProperty
public InstantiationAwarePropertyAccessor(PersistentPropertyAccessor<T> delegate, EntityInstantiators instantiators)
InstantiationAwarePropertyAccessor
using the given delegate PersistentPropertyAccessor
and EntityInstantiators
.delegate
- must not be null.instantiators
- must not be null.public void setProperty(PersistentProperty<?> property, @Nullable Object value)
PersistentPropertyAccessor
PersistentProperty
to the given value. Will do type conversion if a
ConversionService
is configured.setProperty
in interface PersistentPropertyAccessor<T>
property
- must not be null.value
- can be null.@Nullable public Object getProperty(PersistentProperty<?> property)
PersistentPropertyAccessor
PersistentProperty
of the underlying bean instance.getProperty
in interface PersistentPropertyAccessor<T>
property
- must not be null.public T getBean()
PersistentPropertyAccessor
PersistentPropertyAccessor.setProperty(PersistentProperty, Object)
calls.getBean
in interface PersistentPropertyAccessor<T>
Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.