Interface MappingRelationalConverter.ConversionContext
- All Known Implementing Classes:
MappingRelationalConverter.DefaultConversionContext, MappingRelationalConverter.ProjectingConversionContext
- Enclosing class:
MappingRelationalConverter
protected static interface MappingRelationalConverter.ConversionContext
Conversion context defining an interface for graph-traversal-based conversion of row documents. Entrypoint for
recursive conversion of
RowDocument and other types.- Since:
- 3.2
- Author:
- Mark Paluch, Jens Schauder, Chirag Tailor, Vincent Galloy, Chanhyeong Cho, Lukáš Křečan
-
Method Summary
Modifier and TypeMethodDescriptiondefault <S> SConverts a source object intotarget.<S> Sconvert(Object source, org.springframework.data.core.TypeInformation<? extends S> typeHint, MappingRelationalConverter.ConversionContext context) Converts a source object intotarget.forProperty(String name) Obtain aMappingRelationalConverter.ConversionContextfor the given propertyname.forProperty(RelationalPersistentProperty property) Obtain aMappingRelationalConverter.ConversionContextfor the givenRelationalPersistentProperty.getPath()withPath(ObjectPath currentPath) Create a newMappingRelationalConverter.ConversionContextwithcurrentPathapplied.
-
Method Details
-
convert
default <S> S convert(Object source, org.springframework.data.core.TypeInformation<? extends S> typeHint) Converts a source object intotarget.- Parameters:
source- must not be null.typeHint- must not be null.- Returns:
- the converted object.
-
convert
<S> S convert(Object source, org.springframework.data.core.TypeInformation<? extends S> typeHint, MappingRelationalConverter.ConversionContext context) Converts a source object intotarget.- Parameters:
source- must not be null.typeHint- must not be null.context- must not be null.- Returns:
- the converted object.
-
forProperty
Obtain aMappingRelationalConverter.ConversionContextfor the given propertyname.- Parameters:
name- must not be null.- Returns:
- the
MappingRelationalConverter.ConversionContextto be used for conversion of the given property.
-
forProperty
default MappingRelationalConverter.ConversionContext forProperty(RelationalPersistentProperty property) Obtain aMappingRelationalConverter.ConversionContextfor the givenRelationalPersistentProperty.- Parameters:
property- must not be null.- Returns:
- the
MappingRelationalConverter.ConversionContextto be used for conversion of the given property.
-
withPath
Create a newMappingRelationalConverter.ConversionContextwithcurrentPathapplied.- Parameters:
currentPath- must not be null.- Returns:
- a new
MappingRelationalConverter.ConversionContextwithcurrentPathapplied.
-
getPath
ObjectPath getPath()- Returns:
- the current
ObjectPath. Can beObjectPath.ROOTfor top-level contexts.
-
getCustomConversions
CustomConversions getCustomConversions()- Returns:
- the associated conversions.
-
getSourceConverter
RelationalConverter getSourceConverter()- Returns:
- source
RelationalConverter.
-