|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
javanet.staxutils.StAXContentHandler
Base class for SAX-to-STAX bridge classes that provides common functionality.
| Field Summary | |
protected java.lang.StringBuffer |
CDATABuffer
Buffer containing text read within the current CDATA section. |
protected Locator |
docLocator
The SAX Locatorprovided to the handler. |
protected boolean |
isCDATA
Whether the parser is currently within a CDATA section. |
protected SimpleNamespaceContext |
namespaces
Stack used to store declared namespaces. |
protected XMLReporter |
reporter
The STAX XMLReporterregistered to receive notifications. |
| Constructor Summary | |
StAXContentHandler()
|
|
StAXContentHandler(XMLReporter reporter)
|
|
| Method Summary | |
void |
characters(char[] ch,
int start,
int length)
|
void |
comment(char[] ch,
int start,
int length)
|
void |
endCDATA()
|
void |
endDocument()
|
void |
endDTD()
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
|
void |
endEntity(java.lang.String name)
|
void |
endPrefixMapping(java.lang.String prefix)
|
void |
error(SAXParseException e)
|
void |
fatalError(SAXParseException e)
|
Location |
getCurrentLocation()
Calculates the STAX Locationfrom the SAX Locator
registered with this handler. |
static void |
parseQName(java.lang.String qName,
java.lang.String[] results)
Parses an XML qualified name, and places the resulting prefix and local name in the provided String array. |
protected void |
reportException(java.lang.String type,
SAXException e)
Used to report a SAXExceptionto the XMLReporter
registered with this handler. |
void |
setDocumentLocator(Locator locator)
|
void |
setXMLReporter(XMLReporter reporter)
Sets the XMLReporterto which warning and error messages will be
sent. |
void |
startCDATA()
|
void |
startDocument()
|
void |
startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
Attributes attributes)
|
void |
startEntity(java.lang.String name)
|
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
|
void |
warning(SAXParseException e)
|
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, unparsedEntityDecl |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected boolean isCDATA
protected java.lang.StringBuffer CDATABuffer
protected SimpleNamespaceContext namespaces
protected Locator docLocator
Locatorprovided to the handler.
protected XMLReporter reporter
XMLReporterregistered to receive notifications.
| Constructor Detail |
public StAXContentHandler()
public StAXContentHandler(XMLReporter reporter)
| Method Detail |
public void setXMLReporter(XMLReporter reporter)
XMLReporterto which warning and error messages will be
sent.
reporter - The XMLReporterto notify of errors.public void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlerpublic Location getCurrentLocation()
Locationfrom the SAX Locator
registered with this handler. If no Locatorwas provided, then
this method will return null.
public void error(SAXParseException e)
throws SAXException
error in interface ErrorHandlerSAXException
public void fatalError(SAXParseException e)
throws SAXException
fatalError in interface ErrorHandlerSAXException
public void warning(SAXParseException e)
throws SAXException
warning in interface ErrorHandlerSAXException
public void startDocument()
throws SAXException
startDocument in interface ContentHandlerSAXException
public void endDocument()
throws SAXException
endDocument in interface ContentHandlerSAXException
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
Attributes attributes)
throws SAXException
startElement in interface ContentHandlerSAXException
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
throws SAXException
endElement in interface ContentHandlerSAXException
public void startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
throws SAXException
startPrefixMapping in interface ContentHandlerSAXException
public void endPrefixMapping(java.lang.String prefix)
throws SAXException
endPrefixMapping in interface ContentHandlerSAXException
public void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXException
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlerSAXException
public void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXException
public void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlerSAXException
public void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXException
public void endEntity(java.lang.String name)
throws SAXException
endEntity in interface LexicalHandlerSAXException
public void startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
throws SAXException
startDTD in interface LexicalHandlerSAXException
public void startEntity(java.lang.String name)
throws SAXException
startEntity in interface LexicalHandlerSAXException
protected void reportException(java.lang.String type,
SAXException e)
throws SAXException
SAXExceptionto the XMLReporter
registered with this handler.
SAXException
public static final void parseQName(java.lang.String qName,
java.lang.String[] results)
qName - The qualified name to parse.results - An array where parse results will be placed. The prefix
will be placed at results[0], and the local
part at results[1]
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||