public final class MapperRegistry extends Object implements IMapperRegistry
HashMap-based implementation of the IMapperRegistry interface.| Constructor and Description |
|---|
MapperRegistry() |
| Modifier and Type | Method and Description |
|---|---|
<K,V> void |
addMapper(Class<K> keyType,
Class<V> valueType,
Object tag,
IMapper<K,V> mapper)
Registers a mapper for the given tag.
|
<K,V> IMapper<K,V> |
getMapper(Class<K> keyType,
Class<V> valueType,
Object tag)
Returns a mapper that has previously been registered with this instance for the given tag.
|
MapperMetadata |
getMapperMetadata(Object tag)
Gets the mapper
meta data for the mapper that is registered using the tag. |
IEnumerable<Object> |
getRegisteredTags()
Gets an enumerable over all tags that have been used to register mapper implementations with this interface.
|
void |
removeMapper(Object tag)
Removes a previously registered mapper for the given tag.
|
void |
setMapperMetadata(Object tag,
MapperMetadata metadata)
Sets the mapper meta data for the mapper that has been
registered
using the provided tag. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddMapper, addMapper, addMapper, createConstantMapper, createConstantMapper, createConstantMapper, createConstantMapper, createDelegateMapper, createDelegateMapper, createDelegateMapper, createDelegateMapper, createMapper, createMapper, createMapper, createMapper, createWeakMapper, createWeakMapper, createWeakMapper, createWeakMapper, getMapper, getMapper, getMapper, getObjectObjectMapperpublic final <K,V> void addMapper(Class<K> keyType, Class<V> valueType, Object tag, IMapper<K,V> mapper)
IMapperRegistry
If there already was a mapper for tag, it will be replaced.
addMapper in interface IMapperRegistryK - The key type for the mapper.V - The value type for the mapper.keyType - The key type for the mapper.valueType - The value type for the mapper.tag - The tag to use.mapper - The mapper to register.public final <K,V> IMapper<K,V> getMapper(Class<K> keyType, Class<V> valueType, Object tag)
IMapperRegistrygetMapper in interface IMapperRegistryK - The key type for the mapper.V - The value type for the mapper.keyType - The key type for the mapper.valueType - The value type for the mapper.tag - The tag to use to look up the mapper.null.public final MapperMetadata getMapperMetadata(Object tag)
IMapperRegistrymeta data for the mapper that is registered using the tag.getMapperMetadata in interface IMapperRegistrytag - The tag.null if there is no such mapper registered for the given tag.public final IEnumerable<Object> getRegisteredTags()
IMapperRegistrygetRegisteredTags in interface IMapperRegistrypublic final void removeMapper(Object tag)
IMapperRegistryremoveMapper in interface IMapperRegistrytag - The tag that has been used for registering the mapper.public final void setMapperMetadata(Object tag, MapperMetadata metadata)
IMapperRegistryregistered
using the provided tag.setMapperMetadata in interface IMapperRegistrytag - The tag.metadata - The meta data to store with the mapper.