Package com.xmlmind.util
Interface XMLResolver
-
- All Superinterfaces:
EntityResolver
,URIResolver
- All Known Implementing Classes:
XMLResolverImpl
public interface XMLResolver extends EntityResolver, URIResolver
Specifies the catalog-based entity resolution services needed by most XMLmind software components.Implementations are expected to be thread-safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addRewriteURIEntry(String uriStartString, String rewritePrefix)
Adds specified <rewriteURI> entry to the XML catalogs being used by this resolver.String
getResolvedEntity(String publicId, String systemId)
Resolves specified the public identifier/system identifier of an entity.default Source
resolve(String href, String base)
default InputSource
resolveEntity(String publicId, String systemId)
String
resolveURI(String uri)
Resolves specified URI.default URL
resolveURI(String uri, URL baseURL)
Resolves specified URI.
-
-
-
Method Detail
-
addRewriteURIEntry
void addRewriteURIEntry(String uriStartString, String rewritePrefix)
Adds specified <rewriteURI> entry to the XML catalogs being used by this resolver.- 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
String getResolvedEntity(String publicId, String systemId)
Resolves specified the public identifier/system identifier of an entity. If a mapping is found in the XML catalogs, this mapping is returned. Otherwise returnsnull
.- 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
String resolveURI(String uri)
Resolves specified URI. If a mapping is found in the XML catalogs, this mapping is returned. Otherwise returnsnull
.- 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
-
resolveURI
default URL resolveURI(String uri, URL baseURL) throws MalformedURLException
Resolves specified URI. If a mapping is found in the XML catalogs, this mapping is returned. Otherwise specified URI is parsed as an URL (if relative, it is resolved against specified base) and this URL is returned.- Parameters:
uri
- URI for which a mapping is to be found. This URI may have a fragment.baseURL
- base URL used ifuri
needs to be parsed as an URL. May benull
.- Returns:
- resolved URL
- Throws:
MalformedURLException
- if specified URI needs to be parsed as an URL but is malformed
-
resolveEntity
default InputSource resolveEntity(String publicId, String systemId)
- Specified by:
resolveEntity
in interfaceEntityResolver
-
resolve
default Source resolve(String href, String base) throws TransformerException
- Specified by:
resolve
in interfaceURIResolver
- Throws:
TransformerException
-
-