public interface ResourceMappingRegistry extends Iterable<ResourceMapping>
SchemeMappingRegistry provides a mechanism manage a collection
of ResourceMappings, together with the ability to search the registry for
said ResourceMappings, possibly using wild-cards.
ResourceMappingRegistrys are Iterable, the order of iteration
being that in which the ResourceMappings where added to the said
ResourceMappingRegistry.
| Modifier and Type | Method and Description |
|---|---|
default CacheMapping |
findCacheMapping(String sName)
Attempts to find the
CacheMapping that matches the specified
name and type. |
<M extends ResourceMapping> |
findMapping(String sName,
Class<M> type)
Attempts to find the
ResourceMapping that matches the specified
name and type. |
void |
register(ResourceMapping mapping)
Registers a
ResourceMapping with the ResourceMappingRegistry. |
int |
size()
Determines the number of
ResourceMappings in this ResourceMappingRegistry. |
forEach, iterator, spliteratorvoid register(ResourceMapping mapping) throws IllegalArgumentException
ResourceMapping with the ResourceMappingRegistry.mapping - the ResourceMapping to registerIllegalArgumentException - if a ResourceMapping with the same
pattern has already been registereddefault CacheMapping findCacheMapping(String sName)
CacheMapping that matches the specified
name and type.
The matching algorithm first attempts to find an exact match of a
CacheMapping with the provided name. Should that fail,
all of the currently registered wild-carded CacheMappings are
searched to find a match (in the order in which they were registered),
with the most specific (longest match) being returned if there are
multiple matches.
sName - the namenull if a mapping could not be located
for the specified name and type<M extends ResourceMapping> M findMapping(String sName, Class<M> type)
ResourceMapping that matches the specified
name and type.
The matching algorithm first attempts to find an exact match of a
ResourceMapping with the provided name. Should that fail,
all of the currently registered wild-carded ResourceMappings are
searched to find a match (in the order in which they were registered),
with the most specific (longest match) being returned if there are
multiple matches.
sName - the nametype - the type of the mapping to locatenull if a mapping could not be located
for the specified name and typeint size()
ResourceMappings in this ResourceMappingRegistry.ResourceMappings