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 [email protected]

Field Summary
protected  CustomConversions conversions
           
protected  GenericConversionService conversionService
           
protected  org.springframework.data.convert.EntityInstantiators instantiators
           
 
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.
 void setInstantiators(org.springframework.data.convert.EntityInstantiators instantiators)
          Registers EntityInstantiators to customize entity instantiation.
 
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, toDBRef
 
Methods inherited from interface org.springframework.data.convert.EntityWriter
write
 

Field Detail

conversionService

protected final GenericConversionService conversionService

conversions

protected CustomConversions conversions

instantiators

protected org.springframework.data.convert.EntityInstantiators instantiators
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 -

setInstantiators

public void setInstantiators(org.springframework.data.convert.EntityInstantiators instantiators)
Registers EntityInstantiators to customize entity instantiation.

Parameters:
instantiators -

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.