public class BeanWrapper<T> extends Object implements PersistentPropertyAccessor
PersistentPropertys on a given bean.| Modifier | Constructor and Description |
|---|---|
protected |
BeanWrapper(T bean)
Creates a new
BeanWrapper for the given bean. |
| Modifier and Type | Method and Description |
|---|---|
static <T> BeanWrapper<T> |
create(T bean,
ConversionService conversionService)
Deprecated.
use
PersistentEntity.getPropertyAccessor(Object) instead. Will
be removed in 1.10 RC1. |
T |
getBean()
Returns the underlying bean.
|
Object |
getProperty(PersistentProperty<?> property)
Returns the value of the given
PersistentProperty of the underlying bean instance. |
<S> S |
getProperty(PersistentProperty<?> property,
Class<? extends S> type)
Returns the value of the given
PersistentProperty potentially converted to the given type. |
void |
setProperty(PersistentProperty<?> property,
Object value)
Sets the given
PersistentProperty to the given value. |
protected BeanWrapper(T bean)
BeanWrapper for the given bean.bean - must not be null.@Deprecated public static <T> BeanWrapper<T> create(T bean, ConversionService conversionService)
PersistentEntity.getPropertyAccessor(Object) instead. Will
be removed in 1.10 RC1.BeanWrapper for the given bean and ConversionService.TODO: remove!bean - must not be null.conversionService - can be null.public void setProperty(PersistentProperty<?> property, Object value)
PersistentPropertyAccessorPersistentProperty to the given value. Will do type conversion if a
ConversionService is configured.setProperty in interface PersistentPropertyAccessorproperty - must not be null.value - can be null.public Object getProperty(PersistentProperty<?> property)
PersistentPropertyAccessorPersistentProperty of the underlying bean instance.getProperty in interface PersistentPropertyAccessorproperty - must not be null.public <S> S getProperty(PersistentProperty<?> property, Class<? extends S> type)
PersistentProperty potentially converted to the given type.S - property - must not be null.type - can be null.MappingException - in case an exception occured when accessing the property.public T getBean()
PersistentPropertyAccessorgetBean in interface PersistentPropertyAccessorCopyright © 2011-2015–2015 Pivotal Software, Inc.. All rights reserved.