protected class XmlParser.MyHandler extends Object implements ContentHandler
Modifier and Type | Field and Description |
---|---|
(package private) int |
activeDepth |
(package private) boolean |
activeSection |
(package private) StringBuffer |
activeString |
(package private) int |
depth |
(package private) int |
mode
Indicates type of search to be carried out.
|
(package private) String |
searchString |
(package private) String[] |
tags |
(package private) boolean |
testValue |
Constructor and Description |
---|
XmlParser.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.
|
private void |
printAttributes(Attributes atts) |
private void |
printText(String methodName) |
private void |
printText(String methodName,
String itemName) |
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.
|
int mode
Value of LISTTAGS used for the following methods where the goal is to get a list of the tags and their structure in the document.
public Vector parseString (Vector start, File document, String search)
public Vector listTags (Vector start, String document)
public Vector listTags (File document, String search)
public Vector listTags (Vector start, File document, String search)
Value of SEARCH used for the following methods where the goal is to get a list of segments of the documents having the specified tag structure.
public Vector parseString (Vector<String> start, String document, String search )
public Vector parseString (String document, String search)
public Vector parseString (File document, String search)
public Vector parseString (Vector start, File document, String search)
int depth
String searchString
int activeDepth
boolean activeSection
StringBuffer activeString
boolean testValue
public XmlParser.MyHandler(int type, String criteria)
type
- This is an integer value defining the type of
parsing operation to be carried out.criteria
- This String contains the criteria used
for carrying out the parsing operation.private void printAttributes(Attributes atts)
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