Spring Data Document

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

java.lang.Object
  extended by org.springframework.data.document.mongodb.convert.AbstractMongoConverter
All Implemented Interfaces:
InitializingBean, MongoConverter, MongoReader<Object>, MongoWriter<Object>
Direct Known Subclasses:
MappingMongoConverter, SimpleMongoConverter

public abstract class AbstractMongoConverter
extends Object
implements MongoConverter, InitializingBean

Author:
Jon Brisbin <[email protected]>

Field Summary
protected  GenericConversionService conversionService
           
 
Constructor Summary
AbstractMongoConverter(GenericConversionService conversionService)
           
 
Method Summary
 void afterPropertiesSet()
           
 ConversionService getConversionService()
           
protected  Class<?> getCustomTarget(Class<?> source, Class<?> expectedTargetType)
           
 Object[] maybeConvertArray(Object[] src)
           
 BasicDBList maybeConvertList(BasicDBList dbl)
           
 Object maybeConvertObject(Object obj)
           
 void setCustomConverters(Set<?> converters)
          Add custom Converter or ConverterFactory instances to be used that will take presidence over metadata driven conversion between of objects to/from DBObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.data.document.mongodb.convert.MongoConverter
convertObjectId, convertObjectId, getMappingContext
 
Methods inherited from interface org.springframework.data.document.mongodb.MongoWriter
write
 
Methods inherited from interface org.springframework.data.document.mongodb.MongoReader
read
 

Field Detail

conversionService

protected final GenericConversionService conversionService
Constructor Detail

AbstractMongoConverter

public AbstractMongoConverter(GenericConversionService conversionService)
Method Detail

setCustomConverters

public void setCustomConverters(Set<?> converters)
Add custom Converter or ConverterFactory instances to be used that will take presidence over metadata driven conversion between of objects to/from DBObject

Parameters:
converters -

getCustomTarget

protected Class<?> getCustomTarget(Class<?> source,
                                   Class<?> expectedTargetType)

getConversionService

public ConversionService getConversionService()
Specified by:
getConversionService in interface MongoConverter

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface InitializingBean

maybeConvertObject

public Object maybeConvertObject(Object obj)
Specified by:
maybeConvertObject in interface MongoConverter

maybeConvertArray

public Object[] maybeConvertArray(Object[] src)
Specified by:
maybeConvertArray in interface MongoConverter

maybeConvertList

public BasicDBList maybeConvertList(BasicDBList dbl)
Specified by:
maybeConvertList in interface MongoConverter

Spring Data Document

Copyright © 2011. All Rights Reserved.