org.springframework.data.mongodb.core.convert
Class DefaultMongoTypeMapper
java.lang.Object
org.springframework.data.convert.DefaultTypeMapper<com.mongodb.DBObject>
org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper
- All Implemented Interfaces:
- TypeMapper<com.mongodb.DBObject>, MongoTypeMapper
public class DefaultMongoTypeMapper
- extends DefaultTypeMapper<com.mongodb.DBObject>
- implements MongoTypeMapper
Default implementation of MongoTypeMapper
allowing configuration of the key to lookup and store type
information in DBObject
. The key defaults to DEFAULT_TYPE_KEY
. Actual type-to-String
conversion and back is done in #getTypeString(TypeInformation)
or #getTypeInformation(String)
respectively.
- Author:
- Oliver Gierke
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_TYPE_KEY
public static final String DEFAULT_TYPE_KEY
- See Also:
- Constant Field Values
DefaultMongoTypeMapper
public DefaultMongoTypeMapper()
DefaultMongoTypeMapper
public DefaultMongoTypeMapper(String typeKey)
DefaultMongoTypeMapper
public DefaultMongoTypeMapper(String typeKey,
MappingContext<? extends PersistentEntity<?,?>,?> mappingContext)
DefaultMongoTypeMapper
public DefaultMongoTypeMapper(String typeKey,
List<? extends TypeInformationMapper> mappers)
isTypeKey
public boolean isTypeKey(String key)
- Description copied from interface:
MongoTypeMapper
- Returns whether the given key is the type key.
- Specified by:
isTypeKey
in interface MongoTypeMapper
- Returns:
getFallbackTypeFor
protected TypeInformation<?> getFallbackTypeFor(com.mongodb.DBObject source)
- Overrides:
getFallbackTypeFor
in class DefaultTypeMapper<com.mongodb.DBObject>
Copyright © 2011-2013-2013 SpringSource. All Rights Reserved.