|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.tm4j.net.SimpleLocatorResolverManager
A "default" LocatorResolverManager
. This implementation provides an
in-memory registry of resolvers and registers a URILocatorResolver
for the URI notation by default. Other notations may be registered after
construction. The null string is not supported as a notation string.
Notation strings are treated as case-insensitive and are folded to
upper-case.
Field Summary | |
protected java.util.Map |
m_resolversByNotation
A map representing the managed resolvers by notation. |
Constructor Summary | |
SimpleLocatorResolverManager()
Constructs a new instance of this class. |
Method Summary | |
LocatorResolver |
addResolver(java.lang.String notation,
LocatorResolver resolver)
Adds a resolver for the specified notation to this manager. |
LocatorResolver |
getResolver(java.lang.String notation)
Returns the resolver for the specified notation. |
java.util.Map |
getResolverMap()
Returns an unmodifiable Map of resolvers by the notation they resolve. |
void |
removeResolver(java.lang.String notation)
Removes the resolver for the specified notation from the manager. |
java.io.InputStream |
resolve(Locator loc)
Opens an input stream from the location specified by locator . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Map m_resolversByNotation
Constructor Detail |
public SimpleLocatorResolverManager()
LocatorResolver
,
which is a new instance of URILocatorResolver
.
This new resolver is registered to the notation "URI".
Method Detail |
public LocatorResolver addResolver(java.lang.String notation, LocatorResolver resolver)
LocatorResolverManager
addResolver
in interface LocatorResolverManager
notation
- the notation resolved by the resolver.resolver
- the resolver to be added.
notation
or null
if there is no previously registered resolver for
the notation.public LocatorResolver getResolver(java.lang.String notation)
LocatorResolverManager
getResolver
in interface LocatorResolverManager
notation
- the notation to locate the resolver for.
notation
. Returns
null
if no resolver is registered for notation
.public void removeResolver(java.lang.String notation)
LocatorResolverManager
removeResolver
in interface LocatorResolverManager
notation
- The notation for which to remove the resolver.public java.util.Map getResolverMap()
LocatorResolverManager
getResolverMap
in interface LocatorResolverManager
public java.io.InputStream resolve(Locator loc) throws java.io.IOException, LocatorResolutionException
LocatorResolver
locator
.
resolve
in interface LocatorResolver
loc
- the locator for which an input stream is to be opened.
LocatorResolutionException
- if the locator could not be resolved
correctly.
java.io.IOException
- if an unexpected condition occurred while attempting
to open the input stream.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |