org.springframework.data.mongodb.core.convert
Class DefaultMongoTypeMapper
java.lang.Object
org.springframework.data.convert.DefaultTypeMapper<DBObject>
org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper
- All Implemented Interfaces:
- org.springframework.data.convert.TypeMapper<DBObject>, MongoTypeMapper
public class DefaultMongoTypeMapper
- extends org.springframework.data.convert.DefaultTypeMapper<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 org.springframework.data.convert.DefaultTypeMapper |
readType, readType, writeType, writeType |
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.TypeMapper |
readType, readType, writeType, writeType |
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,
org.springframework.data.mapping.context.MappingContext<? extends org.springframework.data.mapping.PersistentEntity<?,?>,?> mappingContext)
DefaultMongoTypeMapper
public DefaultMongoTypeMapper(String typeKey,
List<? extends org.springframework.data.convert.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 org.springframework.data.util.TypeInformation<?> getFallbackTypeFor(DBObject source)
- Overrides:
getFallbackTypeFor
in class org.springframework.data.convert.DefaultTypeMapper<DBObject>
Copyright © 2012. All Rights Reserved.