|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.xml.resolver.tools.ResolvingParser
ResolvingXMLReader for SAX2.
public class ResolvingParser
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.
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 |
|---|
public static boolean namespaceAware
public static boolean validating
public static boolean suppressExplanation
parse(InputSource)| Constructor Detail |
|---|
public ResolvingParser()
public ResolvingParser(CatalogManager manager)
| Method Detail |
|---|
public Catalog getCatalog()
public void parse(InputSource input)
throws java.io.IOException,
SAXException
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.
parse in interface Parserinput - The input source for the top-level of the
XML document.
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.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)
public void parse(java.lang.String systemId)
throws java.io.IOException,
SAXException
parse in interface ParsersystemId - The system identifier (URI).
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.parse(InputSource)public void setDocumentHandler(DocumentHandler handler)
setDocumentHandler in interface Parserhandler - The document handler.DocumentHandler,
HandlerBasepublic void setDTDHandler(DTDHandler handler)
setDTDHandler in interface Parserhandler - The DTD handler.DTDHandler,
HandlerBasepublic void setEntityResolver(EntityResolver resolver)
The purpose of this class is to implement an entity resolver. Attempting to set a different one is pointless (and ignored).
setEntityResolver in interface Parserresolver - The object for resolving entities.EntityResolver,
HandlerBasepublic void setErrorHandler(ErrorHandler handler)
setErrorHandler in interface Parserhandler - The error handler.ErrorHandler,
SAXException,
HandlerBase
public void setLocale(java.util.Locale locale)
throws SAXException
setLocale in interface Parserlocale - A Java Locale object.
SAXException - Throws an exception
(using the previous or default locale) if the
requested locale is not supported.SAXException,
SAXParseException
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface DocumentHandlerch - The characters from the XML document.start - The start position in the array.length - The number of characters to read from the array.
SAXException - Any SAX exception, possibly
wrapping another exception.DocumentHandler.ignorableWhitespace(char[], int, int),
Locator
public void endDocument()
throws SAXException
endDocument in interface DocumentHandlerSAXException - Any SAX exception, possibly
wrapping another exception.
public void endElement(java.lang.String name)
throws SAXException
endElement in interface DocumentHandlername - The element type name
SAXException - Any SAX exception, possibly
wrapping another exception.
public void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface DocumentHandlerch - The characters from the XML document.start - The start position in the array.length - The number of characters to read from the array.
SAXException - Any SAX exception, possibly
wrapping another exception.DocumentHandler.characters(char[], int, int)
public void processingInstruction(java.lang.String target,
java.lang.String pidata)
throws SAXException
processingInstruction in interface DocumentHandlertarget - The processing instruction target.pidata - The processing instruction data, or null if
none was supplied.
SAXException - Any SAX exception, possibly
wrapping another exception.public void setDocumentLocator(Locator locator)
setDocumentLocator in interface DocumentHandlerlocator - An object that can return the location of
any SAX document event.Locator
public void startDocument()
throws SAXException
startDocument in interface DocumentHandlerSAXException - Any SAX exception, possibly
wrapping another exception.
public void startElement(java.lang.String name,
AttributeList atts)
throws SAXException
startElement in interface DocumentHandlername - The element type name.atts - The attributes attached to the element, if any.
SAXException - Any SAX exception, possibly
wrapping another exception.DocumentHandler.endElement(java.lang.String),
AttributeList
public void notationDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
throws SAXException
notationDecl in interface DTDHandlername - 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.
SAXException - Any SAX exception, possibly
wrapping another exception.DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String),
Attributes
public void unparsedEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId,
java.lang.String notationName)
throws SAXException
unparsedEntityDecl in interface DTDHandlername - 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.
SAXException - Any SAX exception, possibly
wrapping another exception.DTDHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String),
Attributes
public InputSource resolveEntity(java.lang.String publicId,
java.lang.String systemId)
resolveEntity method
for the SAX interface, using an underlying CatalogResolver
to do the real work.
resolveEntity in interface EntityResolverpublicId - 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.
InputSource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||