|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.histpop.server.wrappers.DDIParser2
public class DDIParser2
This class is responsible for parsing the DDI XML input DDIParser2 is a SAX parser. The input file is treated as a series of events. Each time the parser encounters an event, a call-back method is invoked. At present this parser only implements the startElement endElement and character callback methods. When a startElement tag is encountered, a new DDINode object is created which wraps up any attributes of the tag, along with its full path. When character text inside a node is encountered, a new DDINode object is created which wraps up this text. Thus for elements containing data, two DDINode objects are produced, one containing the attributes, and the other containing the data. This is a quick fix: it is inefficient and causes other problems. The trouble is, if you postpone generation of the node until any character data has been processed, the elemens will be generated in the wrong order if there are sub elements.
Constructor Summary | |
---|---|
DDIParser2(DDIParserController controller)
Create a new parser, using the controller supplied |
Method Summary | |
---|---|
void |
characters(char[] buf,
int offset,
int len)
Called when text within a tag is detected |
void |
endDocument()
Called on document end |
void |
endElement(java.lang.String namespaceURI,
java.lang.String sName,
java.lang.String qName)
Called when a tag is closed |
void |
parse(java.io.InputStream ddixml)
The parse method is the main entry point for the DDI import package. |
void |
startDocument()
Called on document start |
void |
startElement(java.lang.String namespaceURI,
java.lang.String sName,
java.lang.String qName,
org.xml.sax.Attributes attrs)
Called when a new tag is opened |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DDIParser2(DDIParserController controller)
Method Detail |
---|
public void parse(java.io.InputStream ddixml)
ddixml
- the ddi file to loadpublic void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void startElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void characters(char[] buf, int offset, int len) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |