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
Modifier and TypeClassDescriptionprotected static interface
Converts a containersource
value intothe target type
.protected static interface
Converts a simplesource
value intothe target type
. -
Constructor Summary
ModifierConstructorDescriptionprotected
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 Summary
Modifier and TypeMethodDescription<S> S
convert
(Object source, TypeInformation<? extends S> typeHint, MappingRelationalConverter.ConversionContext context) Converts a source object intotarget
.getPath()
withPath
(ObjectPath currentPath) Create a newMappingRelationalConverter.ConversionContext
withcurrentPath
applied.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.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.ConversionContext
Converts a source object intotarget
.- Specified by:
convert
in 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.ConversionContext
Create a newMappingRelationalConverter.ConversionContext
withcurrentPath
applied.- Specified by:
withPath
in interfaceMappingRelationalConverter.ConversionContext
- Parameters:
currentPath
- must not be null.- Returns:
- a new
MappingRelationalConverter.ConversionContext
withcurrentPath
applied.
-
getPath
- Specified by:
getPath
in interfaceMappingRelationalConverter.ConversionContext
- Returns:
- the current
ObjectPath
. Can beObjectPath.ROOT
for top-level contexts.
-
getCustomConversions
- Specified by:
getCustomConversions
in interfaceMappingRelationalConverter.ConversionContext
- Returns:
- the associated conversions.
-
getSourceConverter
- Specified by:
getSourceConverter
in interfaceMappingRelationalConverter.ConversionContext
- Returns:
- source
RelationalConverter
.
-