protected class XmlParser.MyHandler extends Object implements ContentHandler
Constructor and Description |
---|
MyHandler(int type,
String criteria)
Constructor defining actions taken during parsing.
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] text,
int start,
int length)
This method is called when text is encountered between start
and end tags.
|
void |
endDocument()
Called by the parser when the end of the document
is encountered.
|
void |
endElement(String namespaceURI,
String localName,
String qualifiedName)
Called when an end tag is encountered.
|
void |
endPrefixMapping(String prefix)
Called when prefix mapping is ended.
|
void |
ignorableWhitespace(char[] text,
int start,
int length)
Called when ignorable whitespace is encountered.
|
void |
processingInstruction(String target,
String data) |
void |
setDocumentLocator(Locator locator) |
void |
skippedEntity(String name) |
void |
startDocument()
Called by the parser when the start of the document
is encountered.
|
void |
startElement(String namespaceURI,
String localName,
String qualifiedName,
Attributes atts)
Called when a start tag is encountered.
|
void |
startPrefixMapping(String prefix,
String uri)
Called when prefix mapping is started.
|
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
public void startDocument() throws SAXException
Initializes fields used in parsing document.
startDocument
in interface ContentHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
SAXException
public void startPrefixMapping(String prefix, String uri) throws SAXException
No action is taken for this parser action.
startPrefixMapping
in interface ContentHandler
SAXException
public void endPrefixMapping(String prefix) throws SAXException
No action is taken for this parser action.
endPrefixMapping
in interface ContentHandler
SAXException
public void startElement(String namespaceURI, String localName, String qualifiedName, Attributes atts) throws SAXException
Together with the actions taken in response to the endElement method, this represents the heart of the parsing operation.
startElement
in interface ContentHandler
SAXException
public void endElement(String namespaceURI, String localName, String qualifiedName) throws SAXException
endElement
in interface ContentHandler
SAXException
public void characters(char[] text, int start, int length) throws SAXException
Multiple calls of this method may be executed to handle the text between the tags.
characters
in interface ContentHandler
SAXException
public void ignorableWhitespace(char[] text, int start, int length) throws SAXException
Ignorable whitespace is ignored and no action is taken.
ignorableWhitespace
in interface ContentHandler
SAXException
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
SAXException
public void skippedEntity(String name) throws SAXException
skippedEntity
in interface ContentHandler
SAXException
Copyright © 2017. All rights reserved.