org.apache.xml.resolver.tools
Class ResolvingParser

java.lang.Object
  extended by org.apache.xml.resolver.tools.ResolvingParser
All Implemented Interfaces:
DocumentHandler, DTDHandler, EntityResolver, Parser

Deprecated. This interface has been replaced by the ResolvingXMLReader for SAX2.

public class ResolvingParser
extends java.lang.Object
implements Parser, DTDHandler, DocumentHandler, EntityResolver

A SAX Parser that performs catalog-based entity resolution.

This class implements a SAX Parser that performs entity resolution using the CatalogResolver. The actual, underlying parser is obtained from a SAXParserFactory.

Version:
1.0
Author:
Norman Walsh Norman.Walsh@Sun.COM
See Also:
CatalogResolver, Parser

Field Summary
static boolean namespaceAware
          Deprecated. Make the parser Namespace aware?
static boolean suppressExplanation
          Deprecated. Suppress explanatory message?
static boolean validating
          Deprecated. Make the parser validating?
 
Constructor Summary
ResolvingParser()
          Deprecated. Constructor.
ResolvingParser(CatalogManager manager)
          Deprecated. Constructor.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Deprecated. SAX DocumentHandler API.
 void endDocument()
          Deprecated. SAX DocumentHandler API.
 void endElement(java.lang.String name)
          Deprecated. SAX DocumentHandler API.
 Catalog getCatalog()
          Deprecated. Return the Catalog being used.
 void ignorableWhitespace(char[] ch, int start, int length)
          Deprecated. SAX DocumentHandler API.
 void notationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
          Deprecated. SAX DTDHandler API.
 void parse(InputSource input)
          Deprecated. SAX Parser API.
 void parse(java.lang.String systemId)
          Deprecated. SAX Parser API.
 void processingInstruction(java.lang.String target, java.lang.String pidata)
          Deprecated. SAX DocumentHandler API.
 InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
          Deprecated. Implements the resolveEntity method for the SAX interface, using an underlying CatalogResolver to do the real work.
 void setDocumentHandler(DocumentHandler handler)
          Deprecated. SAX Parser API.
 void setDocumentLocator(Locator locator)
          Deprecated. SAX DocumentHandler API.
 void setDTDHandler(DTDHandler handler)
          Deprecated. SAX Parser API.
 void setEntityResolver(EntityResolver resolver)
          Deprecated. SAX Parser API.
 void setErrorHandler(ErrorHandler handler)
          Deprecated. SAX Parser API.
 void setLocale(java.util.Locale locale)
          Deprecated. SAX Parser API.
 void startDocument()
          Deprecated. SAX DocumentHandler API.
 void startElement(java.lang.String name, AttributeList atts)
          Deprecated. SAX DocumentHandler API.
 void unparsedEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName)
          Deprecated. SAX DTDHandler API.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

namespaceAware

public static boolean namespaceAware
Deprecated. 
Make the parser Namespace aware?


validating

public static boolean validating
Deprecated. 
Make the parser validating?


suppressExplanation

public static boolean suppressExplanation
Deprecated. 
Suppress explanatory message?

See Also:
parse(InputSource)
Constructor Detail

ResolvingParser

public ResolvingParser()
Deprecated. 
Constructor.


ResolvingParser

public ResolvingParser(CatalogManager manager)
Deprecated. 
Constructor.

Method Detail

getCatalog

public Catalog getCatalog()
Deprecated. 
Return the Catalog being used.


parse

public void parse(InputSource input)
           throws java.io.IOException,
                  SAXException
Deprecated. 
SAX Parser API.

Note that the JAXP 1.1ea2 parser crashes with an InternalError if it encounters a system identifier that appears to be a relative URI that begins with a slash. For example, the declaration:

 <!DOCTYPE book SYSTEM "/path/to/dtd/on/my/system/docbookx.dtd">
 

would cause such an error. As a convenience, this method catches that error and prints an explanation. (Unfortunately, it's not possible to identify the particular system identifier that causes the problem.)

The underlying error is forwarded after printing the explanatory message. The message is only every printed once and if suppressExplanation is set to false before parsing, it will never be printed.

Specified by:
parse in interface Parser
Parameters:
input - The input source for the top-level of the XML document.
Throws:
java.io.IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
InputSource, Parser.parse(java.lang.String), Parser.setEntityResolver(org.xml.sax.EntityResolver), Parser.setDTDHandler(org.xml.sax.DTDHandler), Parser.setDocumentHandler(org.xml.sax.DocumentHandler), Parser.setErrorHandler(org.xml.sax.ErrorHandler)

parse

public void parse(java.lang.String systemId)
           throws java.io.IOException,
                  SAXException
Deprecated. 
SAX Parser API.

Specified by:
parse in interface Parser
Parameters:
systemId - The system identifier (URI).
Throws:
java.io.IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
parse(InputSource)

setDocumentHandler

public void setDocumentHandler(DocumentHandler handler)
Deprecated. 
SAX Parser API.

Specified by:
setDocumentHandler in interface Parser
Parameters:
handler - The document handler.
See Also:
DocumentHandler, HandlerBase

setDTDHandler

public void setDTDHandler(DTDHandler handler)
Deprecated. 
SAX Parser API.

Specified by:
setDTDHandler in interface Parser
Parameters:
handler - The DTD handler.
See Also:
DTDHandler, HandlerBase

setEntityResolver

public void setEntityResolver(EntityResolver resolver)
Deprecated. 
SAX Parser API.

The purpose of this class is to implement an entity resolver. Attempting to set a different one is pointless (and ignored).

Specified by:
setEntityResolver in interface Parser
Parameters:
resolver - The object for resolving entities.
See Also:
EntityResolver, HandlerBase

setErrorHandler

public void setErrorHandler(ErrorHandler handler)
Deprecated. 
SAX Parser API.

Specified by:
setErrorHandler in interface Parser
Parameters:
handler - The error handler.
See Also:
ErrorHandler, SAXException, HandlerBase

setLocale

public void setLocale(java.util.Locale locale)
               throws SAXException
Deprecated. 
SAX Parser API.

Specified by:
setLocale in interface Parser
Parameters:
locale - A Java Locale object.
Throws:
SAXException - Throws an exception (using the previous or default locale) if the requested locale is not supported.
See Also:
SAXException, SAXParseException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Deprecated. 
SAX DocumentHandler API.

Specified by:
characters in interface DocumentHandler
Parameters:
ch - The characters from the XML document.
start - The start position in the array.
length - The number of characters to read from the array.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DocumentHandler.ignorableWhitespace(char[], int, int), Locator

endDocument

public void endDocument()
                 throws SAXException
Deprecated. 
SAX DocumentHandler API.

Specified by:
endDocument in interface DocumentHandler
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.

endElement

public void endElement(java.lang.String name)
                throws SAXException
Deprecated. 
SAX DocumentHandler API.

Specified by:
endElement in interface DocumentHandler
Parameters:
name - The element type name
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws SAXException
Deprecated. 
SAX DocumentHandler API.

Specified by:
ignorableWhitespace in interface DocumentHandler
Parameters:
ch - The characters from the XML document.
start - The start position in the array.
length - The number of characters to read from the array.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DocumentHandler.characters(char[], int, int)

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String pidata)
                           throws SAXException
Deprecated. 
SAX DocumentHandler API.

Specified by:
processingInstruction in interface DocumentHandler
Parameters:
target - The processing instruction target.
pidata - The processing instruction data, or null if none was supplied.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.

setDocumentLocator

public void setDocumentLocator(Locator locator)
Deprecated. 
SAX DocumentHandler API.

Specified by:
setDocumentLocator in interface DocumentHandler
Parameters:
locator - An object that can return the location of any SAX document event.
See Also:
Locator

startDocument

public void startDocument()
                   throws SAXException
Deprecated. 
SAX DocumentHandler API.

Specified by:
startDocument in interface DocumentHandler
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.

startElement

public void startElement(java.lang.String name,
                         AttributeList atts)
                  throws SAXException
Deprecated. 
SAX DocumentHandler API.

Specified by:
startElement in interface DocumentHandler
Parameters:
name - The element type name.
atts - The attributes attached to the element, if any.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DocumentHandler.endElement(java.lang.String), AttributeList

notationDecl

public void notationDecl(java.lang.String name,
                         java.lang.String publicId,
                         java.lang.String systemId)
                  throws SAXException
Deprecated. 
SAX DTDHandler API.

Specified by:
notationDecl in interface DTDHandler
Parameters:
name - The notation name.
publicId - The notation's public identifier, or null if none was given.
systemId - The notation's system identifier, or null if none was given.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String), Attributes

unparsedEntityDecl

public void unparsedEntityDecl(java.lang.String name,
                               java.lang.String publicId,
                               java.lang.String systemId,
                               java.lang.String notationName)
                        throws SAXException
Deprecated. 
SAX DTDHandler API.

Specified by:
unparsedEntityDecl in interface DTDHandler
Parameters:
name - The unparsed entity's name.
publicId - The entity's public identifier, or null if none was given.
systemId - The entity's system identifier.
notationName - The name of the associated notation.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DTDHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String), Attributes

resolveEntity

public InputSource resolveEntity(java.lang.String publicId,
                                 java.lang.String systemId)
Deprecated. 
Implements the resolveEntity method for the SAX interface, using an underlying CatalogResolver to do the real work.

Specified by:
resolveEntity in interface EntityResolver
Parameters:
publicId - The public identifier of the external entity being referenced, or null if none was supplied.
systemId - The system identifier of the external entity being referenced.
Returns:
An InputSource object describing the new input source, or null to request that the parser open a regular URI connection to the system identifier.
See Also:
InputSource