public class XmlLoadParser
extends org.xml.sax.helpers.DefaultHandler
Modifier and Type | Class and Description |
---|---|
static class |
XmlLoadParser.Builder
Builder factory for creating a parser.
|
Modifier and Type | Method and Description |
---|---|
static XmlLoadParser.Builder |
builder(DataBase dataBase,
java.io.File inFile)
Create a builder
|
void |
characters(char[] ch,
int start,
int length)
Called when character data is found in document
If we are recording add a text node to DOM tree
|
void |
endDocument()
Called when there are no more nodes in the current document.
|
void |
endElement(java.lang.String uri,
java.lang.String namespc,
java.lang.String name)
Called when the SAX parser reaches a new XML closing tag.
|
void |
fatalError(org.xml.sax.SAXParseException e) |
protected void |
processDOMTree(org.w3c.dom.Document doc)
Called when we have a new DOM tree
|
void |
startDocument()
Called before process begins on current document.
|
void |
startElement(java.lang.String uri,
java.lang.String namespc,
java.lang.String name,
org.xml.sax.Attributes attr)
Called when the SAX parser reaches a new XML tag.
|
@CheckReturnValue @Nonnull public static XmlLoadParser.Builder builder(@Nonnull DataBase dataBase, @Nonnull java.io.File inFile)
dataBase
- the database.inFile
- the file to process.public 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
- a problempublic 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
- a problempublic void startElement(java.lang.String uri, java.lang.String namespc, java.lang.String name, org.xml.sax.Attributes attr) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
uri
- URLnamespc
- the name spacename
- the nameattr
- the attributeorg.xml.sax.SAXException
- a problempublic void endElement(java.lang.String uri, java.lang.String namespc, java.lang.String name) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
uri
- the URInamespc
- the name spacename
- the nameorg.xml.sax.SAXException
- a problempublic void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
ch
- the charactersstart
- the startlength
- the lengthorg.xml.sax.SAXException
- a problempublic void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
fatalError
in class org.xml.sax.helpers.DefaultHandler
e
- the errororg.xml.sax.SAXException
- a problemprotected void processDOMTree(@Nonnull org.w3c.dom.Document doc) throws java.lang.Exception
doc
- the documentjava.lang.Exception
- a serious problemstSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.