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> Sconvert(Object source, TypeInformation<? extends S> typeHint) Converts a source object intotarget.<S> Sconvert(Object source, TypeInformation<? extends S> typeHint, org.springframework.data.mongodb.core.convert.MappingMongoConverter.ConversionContext context) default <S> SfindContextualEntity(MongoPersistentEntity<S> entity, org.bson.Document document) Lookup a potentially existing entity instance of the givenMongoPersistentEntityandDocumentdefault org.springframework.data.mongodb.core.convert.MappingMongoConverter.ConversionContextforProperty(String name) Obtain aMappingMongoConverter.ConversionContextfor the given propertyname.default org.springframework.data.mongodb.core.convert.MappingMongoConverter.ConversionContextforProperty(MongoPersistentProperty property) Obtain aMappingMongoConverter.ConversionContextfor the givenMongoPersistentProperty.org.springframework.data.mongodb.core.convert.ObjectPathgetPath()org.springframework.data.mongodb.core.convert.MappingMongoConverter.ConversionContextwithPath(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.ConversionContextfor the given propertyname.- Parameters:
name- must not be null.- Returns:
- the
MappingMongoConverter.ConversionContextto be used for conversion of the given property.
-
forProperty
default org.springframework.data.mongodb.core.convert.MappingMongoConverter.ConversionContext forProperty(MongoPersistentProperty property) Obtain aMappingMongoConverter.ConversionContextfor the givenMongoPersistentProperty.- Parameters:
property- must not be null.- Returns:
- the
MappingMongoConverter.ConversionContextto 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 givenMongoPersistentEntityandDocument- Type Parameters:
S-- Parameters:
entity-document-- Returns:
-