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, MongoConverter, MongoReader<Object>, 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 [email protected]

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()
          Returns the underlying ConversionService used by the converter.
 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.mongodb.core.convert.MongoConverter
getMappingContext
 
Methods inherited from interface org.springframework.data.mongodb.core.convert.MongoWriter
convertToMongoType, write
 
Methods inherited from interface org.springframework.data.mongodb.core.convert.MongoReader
read
 

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()
Description copied from interface: MongoConverter
Returns the underlying ConversionService used by the converter.

Specified by:
getConversionService in interface MongoConverter
Returns:
never null.

afterPropertiesSet

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

Spring Data Document

Copyright © 2011. All Rights Reserved.