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
ConstructorDescriptionMappingContextTypeInformationMapper
(MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext) Creates aMappingContextTypeInformationMapper
from the givenMappingContext
. -
Method Summary
Modifier and TypeMethodDescriptioncreateAliasFor
(TypeInformation<?> type) Returns the alias to be used for the givenTypeInformation
.resolveTypeFrom
(Alias alias) Returns the actualTypeInformation
to be used for the given alias.
-
Constructor Details
-
MappingContextTypeInformationMapper
public MappingContextTypeInformationMapper(MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext) Creates aMappingContextTypeInformationMapper
from the givenMappingContext
. Inspects allPersistentEntity
instances for alias information and builds aMap
of aliases to types from it.- Parameters:
mappingContext
- must not be null.
-
-
Method Details
-
createAliasFor
Description copied from interface:TypeInformationMapper
Returns the alias to be used for the givenTypeInformation
.- Specified by:
createAliasFor
in interfaceTypeInformationMapper
- Parameters:
type
- must not be null.- Returns:
-
resolveTypeFrom
Description copied from interface:TypeInformationMapper
Returns the actualTypeInformation
to be used for the given alias.- Specified by:
resolveTypeFrom
in interfaceTypeInformationMapper
- Parameters:
alias
- must not be null.- Returns:
-