org.osesb.utilities.xml.compiledschemas
Class DefaultLSResourceResolver

java.lang.Object
  extended by org.osesb.utilities.xml.compiledschemas.DefaultLSResourceResolver
All Implemented Interfaces:
org.w3c.dom.ls.LSResourceResolver
Direct Known Subclasses:
XMLRepositoryLSResourceResolver

public class DefaultLSResourceResolver
extends java.lang.Object
implements org.w3c.dom.ls.LSResourceResolver

This Class implements the LSResourceResolver interface for jaxp v1.3 schema compilation. It is the ancestor of framework LSResourceResolver(s), which resolve external resources when parsing schemas.

Descendants of this class override the resolveResource() method to resolve external resources, when using a jaxp SchemaFactory to produce compiled schemas.

Usage:

Using the SchemaFactory.setResourceResolver() method, set this Class as the LSResourceResolver for SchemaFactory when compiling schemas that might include other schemas.

Since:
Version .9

Field Summary
protected  boolean debugFlag
          The debugFlag for this Object.
protected  DefaultEntityResolver entityResolver
          An EntityResolver to be used by this Class .
protected static org.apache.commons.logging.Log log
          The logging implementation for this class.
protected  java.lang.String thisClassName
          The full name of this class.
 
Constructor Summary
DefaultLSResourceResolver()
          Creates an instance of DefaultLSResourceResolver.
 
Method Summary
 DefaultEntityResolver getEntityResolver()
          Get the EntityResolver used by this Class.
static void main(java.lang.String[] args)
          main() For testing.
 org.w3c.dom.ls.LSInput resolveResource(java.lang.String type, java.lang.String namespaceURI, java.lang.String publicID, java.lang.String systemID, java.lang.String baseURI)
          Called by a SchemaFactory to resolve references to external schemas.
 void setDebugFlag(boolean debugFlag)
          Set the debugFlag for this object.
 void setEntityResolver(DefaultEntityResolver entityResolver)
          Set an EntityResolver to be used by this Class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
The logging implementation for this class.


thisClassName

protected java.lang.String thisClassName
The full name of this class.


debugFlag

protected boolean debugFlag
The debugFlag for this Object.


entityResolver

protected DefaultEntityResolver entityResolver
An EntityResolver to be used by this Class .

Constructor Detail

DefaultLSResourceResolver

public DefaultLSResourceResolver()
Creates an instance of DefaultLSResourceResolver.

Method Detail

resolveResource

public org.w3c.dom.ls.LSInput resolveResource(java.lang.String type,
                                              java.lang.String namespaceURI,
                                              java.lang.String publicID,
                                              java.lang.String systemID,
                                              java.lang.String baseURI)
Called by a SchemaFactory to resolve references to external schemas.

Specified by:
resolveResource in interface org.w3c.dom.ls.LSResourceResolver
Parameters:
type - The type of the resource being resolved. For XML [XML 1.0] resources (i.e. entities), applications must use the value "http://www.w3.org/TR/REC-xml".
namespaceURI - The namespace of the resource being resolved, e.g. the target namespace of the XML Schema when resolving XML Schema.
publicID - The public identifier of the external entity being referenced.
systemID - The system identifier, a URI reference of the external resource being referenced.
baseURI - The absolute base URI of the resource being parsed, or null if there is no base URI.

setEntityResolver

public void setEntityResolver(DefaultEntityResolver entityResolver)
Set an EntityResolver to be used by this Class.

Parameters:
entityResolver - the EntityResolver used by this Class.

getEntityResolver

public DefaultEntityResolver getEntityResolver()
Get the EntityResolver used by this Class.

Returns:
the EntityResolver used by this Class.

setDebugFlag

public void setDebugFlag(boolean debugFlag)
Set the debugFlag for this object.

Parameters:
debugFlag - If true, debug messages are logged.

main

public static void main(java.lang.String[] args)
main() For testing.

Parameters:
args - commandline arguments