Package com.norconex.commons.lang.xml

# Class ClasspathResourceResolver

java.lang.Object
com.norconex.commons.lang.xml.ClasspathResourceResolver

All Implemented Interfaces:
  `LSResourceResolver`

public class ClasspathResourceResolver extends Object implements LSResourceResolver

Resolves XML Schema (XSD) include directives by looking for the specified resource on the Classpath.

To use, set this resolver on your `SchemaFactory`, like this:

     SchemaFactory schemaFactory =
             SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
     schemaFactory.setResourceResolver(
             new ClasspathResourceResolver(MyClass.class));

Since:
  1.13.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ClasspathResourceResolver()`
  `ClasspathResourceResolver(Class<?> relativeTo)`
  Resolves the resource relative to the given class.
  `ClasspathResourceResolver(String relativeTo)`
  Resolves the resource relative to the given package path.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `LSInput`
  `resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ClasspathResourceResolver

    public ClasspathResourceResolver()

  - ### ClasspathResourceResolver

    public ClasspathResourceResolver(Class<?> relativeTo)
    Resolves the resource relative to the given class.
    Parameters:
      `relativeTo` - class to use as base for resolution

  - ### ClasspathResourceResolver

    public ClasspathResourceResolver(String relativeTo)
    Resolves the resource relative to the given package path.
    Parameters:
      `relativeTo` - package path to use as base for resolution

- ## Method Details

  - ### resolveResource

    public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI)
    Specified by:
      `resolveResource` in interface `LSResourceResolver`