|
Spring Data Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.data.mapping.model.BeanWrapper<E,T>
public class BeanWrapper<E extends PersistentEntity<T,?>,T>
Value object to allow creation of objects using the metamodel, setting and getting properties.
Method Summary | ||
---|---|---|
static
|
create(T bean,
org.springframework.core.convert.ConversionService conversionService)
Creates a new BeanWrapper for the given bean instance and ConversionService . |
|
T |
getBean()
Returns the underlying bean instance. |
|
java.lang.Object |
getProperty(PersistentProperty<?> property)
Returns the value of the given PersistentProperty of the underlying bean instance. |
|
|
getProperty(PersistentProperty<?> property,
java.lang.Class<? extends S> type,
boolean fieldAccessOnly)
Returns the value of the given PersistentProperty potentially converted to the given type. |
|
void |
setProperty(PersistentProperty<?> property,
java.lang.Object value)
Sets the given PersistentProperty to the given value. |
|
void |
setProperty(PersistentProperty<?> property,
java.lang.Object value,
boolean fieldAccessOnly)
Sets the given PersistentProperty to the given value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <E extends PersistentEntity<T,?>,T> BeanWrapper<E,T> create(T bean, org.springframework.core.convert.ConversionService conversionService)
BeanWrapper
for the given bean instance and ConversionService
. If
ConversionService
is null no property type conversion will take place.
E
- T
- bean
- must not be nullconversionService
-
public void setProperty(PersistentProperty<?> property, java.lang.Object value) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
PersistentProperty
to the given value. Will do type conversion if a
ConversionService
is configured. Will use the accessor method of the given PersistentProperty
if it
has one or field access otherwise.
property
- value
-
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public void setProperty(PersistentProperty<?> property, java.lang.Object value, boolean fieldAccessOnly)
PersistentProperty
to the given value. Will do type conversion if a
ConversionService
is configured.
property
- value
-
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public java.lang.Object getProperty(PersistentProperty<?> property) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
PersistentProperty
of the underlying bean instance.
S
- property
-
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public <S> S getProperty(PersistentProperty<?> property, java.lang.Class<? extends S> type, boolean fieldAccessOnly)
PersistentProperty
potentially converted to the given type.
S
- property
- type
- fieldAccessOnly
-
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public T getBean()
|
Spring Data Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |