Spring Data Core

org.springframework.data.convert
Class ConfigurableTypeInformationMapper

java.lang.Object
  extended by org.springframework.data.convert.ConfigurableTypeInformationMapper
All Implemented Interfaces:
TypeInformationMapper

public class ConfigurableTypeInformationMapper
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

Constructor Summary
ConfigurableTypeInformationMapper(Map<? extends Class<?>,String> sourceTypeMap)
          Creates a new ConfigurableTypeMapper for the given type map.
 
Method Summary
 Object createAliasFor(TypeInformation<?> type)
          Returns the alias to be used for the given TypeInformation.
 TypeInformation<?> resolveTypeFrom(Object 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

ConfigurableTypeInformationMapper

public ConfigurableTypeInformationMapper(Map<? extends Class<?>,String> sourceTypeMap)
Creates a new ConfigurableTypeMapper for the given type map.

Parameters:
sourceTypeMap - must not be null.
Method Detail

createAliasFor

public Object createAliasFor(TypeInformation<?> type)
Description copied from interface: TypeInformationMapper
Returns the alias to be used for the given TypeInformation.

Specified by:
createAliasFor in interface TypeInformationMapper
Returns:

resolveTypeFrom

public TypeInformation<?> resolveTypeFrom(Object 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 - can be null.
Returns:

Spring Data Core

Copyright © 2011-2013-2013 Pivotal. All Rights Reserved.