org.springframework.data.convert

## Class MappingContextTypeInformationMapper

- java.lang.Object
- - org.springframework.data.convert.MappingContextTypeInformationMapper

All Implemented Interfaces:
  TypeInformationMapper

    public class MappingContextTypeInformationMapper
    extends Object
    implements 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

### Constructor Summary

Constructors
Constructor and Description
`MappingContextTypeInformationMapper(MappingContext<? extends PersistentEntity<?,?>,?> mappingContext)` Creates a `MappingContextTypeInformationMapper` from the given `MappingContext`.

### Method Summary

All Methods Instance Methods Concrete Methods
`Alias` `createAliasFor(TypeInformation<?> type)` Returns the alias to be used for the given `TypeInformation`.
`TypeInformation<?>` `resolveTypeFrom(Alias alias)` Returns the actual `TypeInformation` to be used for the given alias.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### MappingContextTypeInformationMapper

    public MappingContextTypeInformationMapper(MappingContext<? extends PersistentEntity<?,?>,?> mappingContext)

Creates a `MappingContextTypeInformationMapper` from the given `MappingContext`. Inspects all `PersistentEntity` instances for alias information and builds a `Map` of aliases to types from it.

Parameters:
  `mappingContext` - must not be null.

### Method Detail

#### createAliasFor

    public Alias createAliasFor(TypeInformation<?> type)

Description copied from interface: `TypeInformationMapper`
Returns the alias to be used for the given `TypeInformation`.

Specified by:
  `createAliasFor` in interface `TypeInformationMapper`
Parameters:
  `type` - must not be null.
Returns:

#### resolveTypeFrom

    @Nullable
    public TypeInformation<?> resolveTypeFrom(Alias alias)

Description copied from interface: `TypeInformationMapper`
Returns the actual `TypeInformation` to be used for the given alias.

Specified by:
  `resolveTypeFrom` in interface `TypeInformationMapper`
Parameters:
  `alias` - must not be null.
Returns: