Module spring.data.relational
Class MappingRelationalConverter.DefaultConversionContext
java.lang.Object
org.springframework.data.relational.core.conversion.MappingRelationalConverter.DefaultConversionContext
- All Implemented Interfaces:
MappingRelationalConverter.ConversionContext
- Direct Known Subclasses:
MappingRelationalConverter.ProjectingConversionContext
- Enclosing class:
- MappingRelationalConverter
protected static class MappingRelationalConverter.DefaultConversionContext
extends Object
implements MappingRelationalConverter.ConversionContext
Conversion context holding references to simple
MappingRelationalConverter.DefaultConversionContext.ValueConverter and MappingRelationalConverter.DefaultConversionContext.ContainerValueConverter.
Entrypoint for recursive conversion of RowDocument and other types.- Since:
- 3.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceConverts a containersourcevalue intothe target type.protected static interfaceConverts a simplesourcevalue intothe target type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultConversionContext(RelationalConverter sourceConverter, CustomConversions customConversions, ObjectPath objectPath, MappingRelationalConverter.DefaultConversionContext.ContainerValueConverter<RowDocument> documentConverter, MappingRelationalConverter.DefaultConversionContext.ContainerValueConverter<Collection<?>> collectionConverter, MappingRelationalConverter.DefaultConversionContext.ContainerValueConverter<Map<?, ?>> mapConverter, MappingRelationalConverter.DefaultConversionContext.ValueConverter<Object> elementConverter) -
Method Summary
Modifier and TypeMethodDescription<S> Sconvert(Object source, TypeInformation<? extends S> typeHint, MappingRelationalConverter.ConversionContext context) Converts a source object intotarget.getPath()withPath(ObjectPath currentPath) Create a newMappingRelationalConverter.ConversionContextwithcurrentPathapplied.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.relational.core.conversion.MappingRelationalConverter.ConversionContext
convert, forProperty, forProperty
-
Constructor Details
-
DefaultConversionContext
protected DefaultConversionContext(RelationalConverter sourceConverter, CustomConversions customConversions, ObjectPath objectPath, MappingRelationalConverter.DefaultConversionContext.ContainerValueConverter<RowDocument> documentConverter, MappingRelationalConverter.DefaultConversionContext.ContainerValueConverter<Collection<?>> collectionConverter, MappingRelationalConverter.DefaultConversionContext.ContainerValueConverter<Map<?, ?>> mapConverter, MappingRelationalConverter.DefaultConversionContext.ValueConverter<Object> elementConverter)
-
-
Method Details
-
convert
public <S> S convert(Object source, TypeInformation<? extends S> typeHint, MappingRelationalConverter.ConversionContext context) Description copied from interface:MappingRelationalConverter.ConversionContextConverts a source object intotarget.- Specified by:
convertin interfaceMappingRelationalConverter.ConversionContext- Parameters:
source- must not be null.typeHint- must not be null.context- must not be null.- Returns:
- the converted object.
-
withPath
Description copied from interface:MappingRelationalConverter.ConversionContextCreate a newMappingRelationalConverter.ConversionContextwithcurrentPathapplied.- Specified by:
withPathin interfaceMappingRelationalConverter.ConversionContext- Parameters:
currentPath- must not be null.- Returns:
- a new
MappingRelationalConverter.ConversionContextwithcurrentPathapplied.
-
getPath
- Specified by:
getPathin interfaceMappingRelationalConverter.ConversionContext- Returns:
- the current
ObjectPath. Can beObjectPath.ROOTfor top-level contexts.
-
getCustomConversions
- Specified by:
getCustomConversionsin interfaceMappingRelationalConverter.ConversionContext- Returns:
- the associated conversions.
-
getSourceConverter
- Specified by:
getSourceConverterin interfaceMappingRelationalConverter.ConversionContext- Returns:
- source
RelationalConverter.
-