Spring Data Document

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

java.lang.Object
  extended by org.springframework.data.mongodb.core.convert.AbstractMongoConverter
All Implemented Interfaces:
InitializingBean, org.springframework.data.convert.EntityConverter<MongoPersistentEntity<?>,MongoPersistentProperty,Object,DBObject>, org.springframework.data.convert.EntityReader<Object,DBObject>, org.springframework.data.convert.EntityWriter<Object,DBObject>, MongoConverter, MongoWriter<Object>
Direct Known Subclasses:
MappingMongoConverter

public abstract class AbstractMongoConverter
extends Object
implements MongoConverter, InitializingBean

Base class for MongoConverter implementations. Sets up a GenericConversionService and populates basic converters. Allows registering CustomConversions.

Author:
Jon Brisbin , Oliver Gierke ogierke@vmware.com

Field Summary
protected  CustomConversions conversions
           
protected  GenericConversionService conversionService
           
 
Constructor Summary
AbstractMongoConverter(GenericConversionService conversionService)
          Creates a new AbstractMongoConverter using the given GenericConversionService.
 
Method Summary
 void afterPropertiesSet()
           
 ConversionService getConversionService()
           
 void setCustomConversions(CustomConversions conversions)
          Registers the given custom conversions with the converter.
 
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.convert.EntityConverter
getMappingContext
 
Methods inherited from interface org.springframework.data.convert.EntityReader
read
 
Methods inherited from interface org.springframework.data.mongodb.core.convert.MongoWriter
convertToMongoType
 
Methods inherited from interface org.springframework.data.convert.EntityWriter
write
 

Field Detail

conversionService

protected final GenericConversionService conversionService

conversions

protected CustomConversions conversions
Constructor Detail

AbstractMongoConverter

public AbstractMongoConverter(GenericConversionService conversionService)
Creates a new AbstractMongoConverter using the given GenericConversionService.

Parameters:
conversionService -
Method Detail

setCustomConversions

public void setCustomConversions(CustomConversions conversions)
Registers the given custom conversions with the converter.

Parameters:
conversions -

getConversionService

public ConversionService getConversionService()
Specified by:
getConversionService in interface org.springframework.data.convert.EntityConverter<MongoPersistentEntity<?>,MongoPersistentProperty,Object,DBObject>

afterPropertiesSet

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

Spring Data Document

Copyright © 2012. All Rights Reserved.