org.springframework.data.document.mongodb.convert
Class MongoBeanWrapper

java.lang.Object
  extended by org.springframework.data.document.mongodb.convert.MongoBeanWrapper

 class MongoBeanWrapper
extends java.lang.Object

Custom Mongo specific BeanWrapper to allow access to bean properties via MongoPropertyDescriptors.MongoPropertyDescriptors.

Author:
Oliver Gierke

Field Summary
private  ConfigurablePropertyAccessor accessor
           
private  MongoPropertyDescriptors descriptors
           
private  boolean fieldAccess
           
 
Constructor Summary
MongoBeanWrapper(java.lang.Object target, ConversionService conversionService, boolean fieldAccess)
          Creates a new MongoBeanWrapper for the given target object and ConversionService.
 
Method Summary
 MongoPropertyDescriptors getDescriptors()
          Returns all MongoPropertyDescriptors.MongoPropertyDescriptors for the underlying target object.
 java.lang.Object getValue(MongoPropertyDescriptors.MongoPropertyDescriptor descriptor)
          Returns the value of the underlying object for the given property.
 void setValue(MongoPropertyDescriptors.MongoPropertyDescriptor descriptor, java.lang.Object value)
          Sets the property of the underlying object to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

accessor

private final ConfigurablePropertyAccessor accessor

descriptors

private final MongoPropertyDescriptors descriptors

fieldAccess

private final boolean fieldAccess
Constructor Detail

MongoBeanWrapper

public MongoBeanWrapper(java.lang.Object target,
                        ConversionService conversionService,
                        boolean fieldAccess)
Creates a new MongoBeanWrapper for the given target object and ConversionService.

Parameters:
target -
conversionService -
fieldAccess -
Method Detail

getDescriptors

public MongoPropertyDescriptors getDescriptors()
Returns all MongoPropertyDescriptors.MongoPropertyDescriptors for the underlying target object.

Returns:

getValue

public java.lang.Object getValue(MongoPropertyDescriptors.MongoPropertyDescriptor descriptor)
Returns the value of the underlying object for the given property.

Parameters:
descriptor -
Returns:

setValue

public void setValue(MongoPropertyDescriptors.MongoPropertyDescriptor descriptor,
                     java.lang.Object value)
Sets the property of the underlying object to the given value.

Parameters:
descriptor -
value -