uk.org.ogsadai.common.xml
Class SchemaEntityResolver

java.lang.Object
  |
  +--uk.org.ogsadai.common.xml.SchemaEntityResolver
All Implemented Interfaces:
org.xml.sax.EntityResolver

class SchemaEntityResolver
extends java.lang.Object
implements org.xml.sax.EntityResolver

A custom org.xml.sax.EntityResolver used by XMLSchemaUtilities to map a schema location to a schema document. This allows a document to be validated against a schema assembled dynamically in memory, instead of the usual behaviour where a schema will be loaded from a URL.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private static DAILogger LOG
           
private  java.lang.String mNamespace
           
private  java.lang.String mSchema
           
 
Constructor Summary
(package private) SchemaEntityResolver(org.w3c.dom.Document schema)
          Constructs an instance for the given XML Schema.
 
Method Summary
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

LOG

private static final DAILogger LOG

mNamespace

private final java.lang.String mNamespace

mSchema

private final java.lang.String mSchema
Constructor Detail

SchemaEntityResolver

SchemaEntityResolver(org.w3c.dom.Document schema)
Constructs an instance for the given XML Schema. The target namespace of the XML Schema will be resolved to the schema document by the resolveEntity method.

Parameters:
schema - The XML Schema document.
Throws:
java.lang.IllegalArgumentException - if schema is null.
Method Detail

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws org.xml.sax.SAXException,
                                             java.io.IOException
Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
org.xml.sax.SAXException
java.io.IOException