Module spring.data.commons
Package org.springframework.data.convert
Class MappingContextTypeInformationMapper
java.lang.Object
org.springframework.data.convert.MappingContextTypeInformationMapper
- All Implemented Interfaces:
TypeInformationMapper
TypeInformationMapper implementation that can be either set up using a MappingContext or manually set
up Map of String aliases to types. If a MappingContext is used the Map will be build
inspecting the PersistentEntity instances for type alias information.- Author:
- Oliver Gierke, Christoph Strobl, Johannes Englmeier
-
Constructor Summary
ConstructorsConstructorDescriptionMappingContextTypeInformationMapper(MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext) Creates aMappingContextTypeInformationMapperfrom the givenMappingContext. -
Method Summary
Modifier and TypeMethodDescriptioncreateAliasFor(TypeInformation<?> type) Returns the alias to be used for the givenTypeInformation.resolveTypeFrom(Alias alias) Returns the actualTypeInformationto be used for the given alias.
-
Constructor Details
-
MappingContextTypeInformationMapper
public MappingContextTypeInformationMapper(MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext) Creates aMappingContextTypeInformationMapperfrom the givenMappingContext. Inspects allPersistentEntityinstances for alias information and builds aMapof aliases to types from it.- Parameters:
mappingContext- must not be null.
-
-
Method Details
-
createAliasFor
Description copied from interface:TypeInformationMapperReturns the alias to be used for the givenTypeInformation.- Specified by:
createAliasForin interfaceTypeInformationMapper- Parameters:
type- must not be null.- Returns:
-
resolveTypeFrom
Description copied from interface:TypeInformationMapperReturns the actualTypeInformationto be used for the given alias.- Specified by:
resolveTypeFromin interfaceTypeInformationMapper- Parameters:
alias- must not be null.- Returns:
-