edu.ucsb.nceas.metacat
Class DBEntityResolver

java.lang.Object
  |
  +--edu.ucsb.nceas.metacat.DBEntityResolver
All Implemented Interfaces:
org.xml.sax.EntityResolver

public class DBEntityResolver
extends java.lang.Object
implements org.xml.sax.EntityResolver

A database aware Class implementing EntityResolver interface for the SAX parser to call when processing the XML stream and intercepting any external entities (including the external DTD subset and external parameter entities, if any) before including them.


Constructor Summary
DBEntityResolver(DBConnection conn)
          Construct an instance of the DBEntityResolver class
DBEntityResolver(DBConnection conn, org.xml.sax.helpers.DefaultHandler handler, java.io.Reader dtd)
          Construct an instance of the DBEntityResolver class
 
Method Summary
static java.io.InputStream checkURLConnection(java.lang.String systemId)
          Check URL Connection for @systemId, and return an InputStream that can be used to read from the systemId URL.
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
          The Parser call this method before opening any external entity except the top-level document entity (including the external DTD subset, external entities referenced within the DTD, and external entities referenced within the document element)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBEntityResolver

public DBEntityResolver(DBConnection conn)
Construct an instance of the DBEntityResolver class

Parameters:
conn - the JDBC connection to which information is written

DBEntityResolver

public DBEntityResolver(DBConnection conn,
                        org.xml.sax.helpers.DefaultHandler handler,
                        java.io.Reader dtd)
Construct an instance of the DBEntityResolver class

Parameters:
conn - the JDBC connection to which information is written
handler - the SAX handler to determine parsing context
dtd - Reader of new dtd to be uploaded on server's file system
Method Detail

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws org.xml.sax.SAXException
The Parser call this method before opening any external entity except the top-level document entity (including the external DTD subset, external entities referenced within the DTD, and external entities referenced within the document element)

Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
org.xml.sax.SAXException

checkURLConnection

public static java.io.InputStream checkURLConnection(java.lang.String systemId)
                                              throws org.xml.sax.SAXException
Check URL Connection for @systemId, and return an InputStream that can be used to read from the systemId URL. The parser ends up using this via the InputSource to read the DTD.

Parameters:
systemId - a URI (in practice URL) to be checked and opened
org.xml.sax.SAXException


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.