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, wait
addMapper, addMapper, addMapper, createConstantMapper, createConstantMapper, createConstantMapper, createConstantMapper, createDelegateMapper, createDelegateMapper, createDelegateMapper, createDelegateMapper, createMapper, createMapper, createMapper, createMapper, createWeakMapper, createWeakMapper, createWeakMapper, createWeakMapper, getMapper, getMapper, getMapper, getObjectObjectMapper
public 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 IMapperRegistry
K
- 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)
IMapperRegistry
getMapper
in interface IMapperRegistry
K
- 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)
IMapperRegistry
meta data
for the mapper that is registered using the tag
.getMapperMetadata
in interface IMapperRegistry
tag
- The tag.null
if there is no such mapper registered for the given tag.public final IEnumerable<Object> getRegisteredTags()
IMapperRegistry
getRegisteredTags
in interface IMapperRegistry
public final void removeMapper(Object tag)
IMapperRegistry
removeMapper
in interface IMapperRegistry
tag
- The tag that has been used for registering the mapper.public final void setMapperMetadata(Object tag, MapperMetadata metadata)
IMapperRegistry
registered
using the provided tag
.setMapperMetadata
in interface IMapperRegistry
tag
- The tag.metadata
- The meta data to store with the mapper.