com.xmlmind.domutil
Class ResolverImpl

java.lang.Object
  extended by com.xmlmind.domutil.ResolverImpl
All Implemented Interfaces:
Resolver

public final class ResolverImpl
extends java.lang.Object
implements Resolver

An implementation of Resolver based on XML catalogs.

This class is as thread-safe.

See Also:
XML Entity and URI Resolvers

Constructor Summary
ResolverImpl()
           
 
Method Summary
 void addRewriteURIEntry(java.lang.String uriStartString, java.lang.String rewritePrefix)
          Adds specified <rewriteURI> entry to the underlying XML catalogs.
 org.xml.sax.EntityResolver getEntityResolver()
          Returns a properly configured, ready to use, EntityResolver.
 javax.xml.transform.URIResolver getURIResolver()
          Returns a properly configured, ready to use, URIResolver.
 java.lang.String resolveURI(java.lang.String uri)
          Resolves specified URI.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResolverImpl

public ResolverImpl()
Method Detail

addRewriteURIEntry

public void addRewriteURIEntry(java.lang.String uriStartString,
                               java.lang.String rewritePrefix)
Adds specified <rewriteURI> entry to the underlying XML catalogs.

Parameters:
uriStartString - prefix of an URI
rewritePrefix - new prefix for URIs starting with uriStartString. Must be the start of an absolute URL in order to be able to use this entry to resolve URIs.

getEntityResolver

public org.xml.sax.EntityResolver getEntityResolver()
Description copied from interface: Resolver
Returns a properly configured, ready to use, EntityResolver. May return null.

Specified by:
getEntityResolver in interface Resolver

getURIResolver

public javax.xml.transform.URIResolver getURIResolver()
Description copied from interface: Resolver
Returns a properly configured, ready to use, URIResolver. May return null.

Specified by:
getURIResolver in interface Resolver

resolveURI

public java.lang.String resolveURI(java.lang.String uri)
Description copied from interface: Resolver
Resolves specified URI. If a mapping is found for specified URI, this mapping is returned. Otherwise returns null.

Specified by:
resolveURI in interface Resolver
Parameters:
uri - URI for which a mapping is to be found. This URI may have a fragment.
Returns:
found mapping or null