Top Description Fields Constructors Methods
uk.ac.ed.ph.snuggletex.utilities

public final Class ClassPathURIResolver

extends Object
implements URIResolver
Class Inheritance
All Implemented Interfaces
javax.xml.transform.URIResolver
Imports
java.io.InputStream, java.net.URI, .URISyntaxException, javax.xml.transform.Source, .TransformerException, .URIResolver, javax.xml.transform.stream.StreamSource

Trivial implementation of URIResolver that looks for resources via the ClassLoader.

Such resources should be specified via a special URI scheme called URI_SCHEME, i.e. of the form classpath:/uk/ac/ed/ph/snuggletex/thingy.xsl.

(The '/' is required here, unlike the similar mechanism in Spring Framework.)

Author
David McKain
Version
$Revision$

Field Summary

Modifier and TypeField and Description
private static final ClassPathURIResolver
public static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ClassPathURIResolver
public Source
resolve(String href, String base)

Implements javax.xml.transform.URIResolver.resolve.

Called by the processor when it encounters an xsl:include, xsl:import, or document() function.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

singletonInstanceback to summary
private static final ClassPathURIResolver singletonInstance
URI_SCHEMEback to summary
public static final String URI_SCHEME

Constructor Detail

ClassPathURIResolverback to summary
private ClassPathURIResolver()

Method Detail

getInstanceback to summary
public static ClassPathURIResolver getInstance()
resolveback to summary
public Source resolve(String href, String base) throws TransformerException

Implements javax.xml.transform.URIResolver.resolve.

Doc from javax.xml.transform.URIResolver.resolve.

Called by the processor when it encounters an xsl:include, xsl:import, or document() function.

Exceptions
TransformerException:
if an error occurs when trying to resolve the URI.