Class MappingMongoConverter.DefaultConversionContext
java.lang.Object
org.springframework.data.mongodb.core.convert.MappingMongoConverter.DefaultConversionContext
- Enclosing class:
- MappingMongoConverter
Conversion context holding references to simple
MappingMongoConverter.DefaultConversionContext.ValueConverter
and MappingMongoConverter.DefaultConversionContext.ContainerValueConverter
.
Entrypoint for recursive conversion of Document
and other types.- Since:
- 3.2
-
Method Summary
Modifier and TypeMethodDescriptiondefault <S> S
convert
(Object source, TypeInformation<? extends S> typeHint) Converts a source object intotarget
.<S> S
convert
(Object source, TypeInformation<? extends S> typeHint, org.springframework.data.mongodb.core.convert.MappingMongoConverter.ConversionContext context) default <S> S
findContextualEntity
(MongoPersistentEntity<S> entity, org.bson.Document document) Lookup a potentially existing entity instance of the givenMongoPersistentEntity
andDocument
default org.springframework.data.mongodb.core.convert.MappingMongoConverter.ConversionContext
forProperty
(String name) Obtain aMappingMongoConverter.ConversionContext
for the given propertyname
.default org.springframework.data.mongodb.core.convert.MappingMongoConverter.ConversionContext
forProperty
(MongoPersistentProperty property) Obtain aMappingMongoConverter.ConversionContext
for the givenMongoPersistentProperty
.org.springframework.data.mongodb.core.convert.ObjectPath
getPath()
org.springframework.data.mongodb.core.convert.MappingMongoConverter.ConversionContext
withPath
(org.springframework.data.mongodb.core.convert.ObjectPath currentPath)
-
Method Details
-
convert
public <S> S convert(Object source, TypeInformation<? extends S> typeHint, org.springframework.data.mongodb.core.convert.MappingMongoConverter.ConversionContext context) -
getCustomConversions
-
getSourceConverter
-
withPath
public org.springframework.data.mongodb.core.convert.MappingMongoConverter.ConversionContext withPath(org.springframework.data.mongodb.core.convert.ObjectPath currentPath) -
getPath
public org.springframework.data.mongodb.core.convert.ObjectPath getPath() -
convert
Converts a source object intotarget
.- Parameters:
source
- must not be null.typeHint
- must not be null.- Returns:
- the converted object.
-
forProperty
default org.springframework.data.mongodb.core.convert.MappingMongoConverter.ConversionContext forProperty(String name) Obtain aMappingMongoConverter.ConversionContext
for the given propertyname
.- Parameters:
name
- must not be null.- Returns:
- the
MappingMongoConverter.ConversionContext
to be used for conversion of the given property.
-
forProperty
default org.springframework.data.mongodb.core.convert.MappingMongoConverter.ConversionContext forProperty(MongoPersistentProperty property) Obtain aMappingMongoConverter.ConversionContext
for the givenMongoPersistentProperty
.- Parameters:
property
- must not be null.- Returns:
- the
MappingMongoConverter.ConversionContext
to be used for conversion of the given property.
-
findContextualEntity
@Nullable default <S> S findContextualEntity(MongoPersistentEntity<S> entity, org.bson.Document document) Lookup a potentially existing entity instance of the givenMongoPersistentEntity
andDocument
- Type Parameters:
S
-- Parameters:
entity
-document
-- Returns:
-