Package com.xmlmind.domutil
Class XMLResolverImpl
- java.lang.Object
-
- com.xmlmind.domutil.XMLResolverImpl
-
- All Implemented Interfaces:
XMLResolver,URIResolver,EntityResolver
public final class XMLResolverImpl extends Object implements XMLResolver
An implementation ofXMLResolverbased on XMLResolver: An enhanced XML resolver with XML Catalog support.This class is thread-safe.
-
-
Constructor Summary
Constructors Constructor Description XMLResolverImpl()Equivalent toXMLResolverImpl(null).XMLResolverImpl(URL[] urls)Constructs anXMLResolverImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRewriteURIEntry(String uriStartString, String rewritePrefix)Adds specified <rewriteURI> entry to the XML catalogs being used by this resolver.StringgetResolvedEntity(String publicId, String systemId)Resolves specified the public identifier/system identifier of an entity.StringresolveURI(String uri)Resolves specified URI.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.xmlmind.util.XMLResolver
resolve, resolveEntity, resolveURI
-
-
-
-
Constructor Detail
-
XMLResolverImpl
public XMLResolverImpl()
Equivalent toXMLResolverImpl(null).Useful when the list of XML catalog files is specified by the value of system property
xml.catalog.files.
-
XMLResolverImpl
public XMLResolverImpl(URL[] urls)
Constructs anXMLResolverImpl.- Parameters:
urls- the URLs of the XML catalog files to be used by this XML resolver. Ifnull, this list is specified by the value of system propertyxml.catalog.files, if any.
-
-
Method Detail
-
addRewriteURIEntry
public void addRewriteURIEntry(String uriStartString, String rewritePrefix)
Description copied from interface:XMLResolverAdds specified <rewriteURI> entry to the XML catalogs being used by this resolver.- Specified by:
addRewriteURIEntryin interfaceXMLResolver- Parameters:
uriStartString- prefix of an URIrewritePrefix- new prefix for URIs starting withuriStartString. Must be the start of an absolute URL in order to be able to use this entry to resolve URIs.
-
getResolvedEntity
public String getResolvedEntity(String publicId, String systemId)
Description copied from interface:XMLResolverResolves specified the public identifier/system identifier of an entity. If a mapping is found in the XML catalogs, this mapping is returned. Otherwise returnsnull.- Specified by:
getResolvedEntityin interfaceXMLResolver- Parameters:
publicId- the public identifier of the entity. May benull.systemId- the system identifier of the entity. Notnull.- Returns:
- found mapping (a URI reference) or
null
-
resolveURI
public String resolveURI(String uri)
Description copied from interface:XMLResolverResolves specified URI. If a mapping is found in the XML catalogs, this mapping is returned. Otherwise returnsnull.- Specified by:
resolveURIin interfaceXMLResolver- Parameters:
uri- URI for which a mapping is to be found. This URI may have a fragment.- Returns:
- found mapping (a URI reference) or
null
-
-