|
Project 1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcscie259.project1.mf.XMLParser
A simplified XML parser. In essence, this class supports a subset of the functionality collectively offered by javax.xml.parsers.SAXParser and javax.xml.parsers.DocumentBuilder. You MAY modify this file.
Constructor Summary | |
XMLParser()
|
Method Summary | |
protected boolean |
isEndTag()
Returns true if the next characters in the stream are the beginning of an element's end tag. |
protected boolean |
isStartTag()
Returns true if the next character in the stream is the beginning of an element's start tag. |
void |
parse(java.lang.String filename,
ContentHandler handler)
Parses the specified file, if possible, passing SAX events to given handler. |
protected void |
readElement()
Parses an element and its content. |
protected void |
readEndTag(java.lang.String checkName)
Parses an end tag, ensuring its name matches currently opened element's name. |
protected java.lang.String |
readStartTag()
Parses a start tag, returning opened element's name. |
protected void |
readText()
Parses character data. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLParser()
Method Detail |
protected boolean isEndTag()
protected boolean isStartTag()
public void parse(java.lang.String filename, ContentHandler handler)
filename
- name of file whose contents are to be parsedhandler
- ContentHandler for SAX eventsprotected void readElement()
protected void readEndTag(java.lang.String checkName)
checkName
- currently opened element's name with which
end tag should be comparedprotected java.lang.String readStartTag()
protected void readText()
|
Project 1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |