ResolvingXMLReader for SAX2.public class ResolvingParser extends Object implements Parser, DTDHandler, DocumentHandler, EntityResolver
This class implements a SAX Parser that performs entity resolution using the CatalogResolver. The actual, underlying parser is obtained from a SAXParserFactory.
CatalogResolver,
Parser| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
ResolvingParser()
Deprecated.
Constructor.
|
ResolvingParser(CatalogManager manager)
Deprecated.
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length)
Deprecated.
SAX DocumentHandler API.
|
void |
endDocument()
Deprecated.
SAX DocumentHandler API.
|
void |
endElement(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(String name,
String publicId,
String systemId)
Deprecated.
SAX DTDHandler API.
|
void |
parse(InputSource input)
Deprecated.
SAX Parser API.
|
void |
parse(String systemId)
Deprecated.
SAX Parser API.
|
void |
processingInstruction(String target,
String pidata)
Deprecated.
SAX DocumentHandler API.
|
InputSource |
resolveEntity(String publicId,
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(Locale locale)
Deprecated.
SAX Parser API.
|
void |
startDocument()
Deprecated.
SAX DocumentHandler API.
|
void |
startElement(String name,
AttributeList atts)
Deprecated.
SAX DocumentHandler API.
|
void |
unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName)
Deprecated.
SAX DTDHandler API.
|
public static boolean namespaceAware
public static boolean validating
public static boolean suppressExplanation
parse(InputSource)public ResolvingParser()
public ResolvingParser(CatalogManager manager)
public Catalog getCatalog()
public void parse(InputSource input) throws 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 ParserIOExceptionSAXExceptionpublic void parse(String systemId) throws IOException, SAXException
parse in interface ParserIOExceptionSAXExceptionparse(InputSource)public void setDocumentHandler(DocumentHandler handler)
setDocumentHandler in interface Parserpublic void setDTDHandler(DTDHandler handler)
setDTDHandler in interface Parserpublic 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 Parserpublic void setErrorHandler(ErrorHandler handler)
setErrorHandler in interface Parserpublic void setLocale(Locale locale) throws SAXException
setLocale in interface ParserSAXExceptionpublic void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface DocumentHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface DocumentHandlerSAXExceptionpublic void endElement(String name) throws SAXException
endElement in interface DocumentHandlerSAXExceptionpublic void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface DocumentHandlerSAXExceptionpublic void processingInstruction(String target, String pidata) throws SAXException
processingInstruction in interface DocumentHandlerSAXExceptionpublic void setDocumentLocator(Locator locator)
setDocumentLocator in interface DocumentHandlerpublic void startDocument()
throws SAXException
startDocument in interface DocumentHandlerSAXExceptionpublic void startElement(String name, AttributeList atts) throws SAXException
startElement in interface DocumentHandlerSAXExceptionpublic void notationDecl(String name, String publicId, String systemId) throws SAXException
notationDecl in interface DTDHandlerSAXExceptionpublic void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException
unparsedEntityDecl in interface DTDHandlerSAXExceptionpublic InputSource resolveEntity(String publicId, String systemId)
resolveEntity method
for the SAX interface, using an underlying CatalogResolver
to do the real work.resolveEntity in interface EntityResolverCopyright © 2005–2017 Oracle Corporation. All rights reserved.