public abstract class Builder extends Progress
Parser sends events to this class whenever nodes
are to be added or closed. The builder implementation decides whether
the nodes are stored on disk or kept in memory.| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addAttr(int nm,
byte[] value,
int dist,
int uri)
Adds an attribute to the database.
|
protected abstract void |
addDoc(byte[] value)
Adds a document node to the database.
|
protected abstract void |
addElem(int dist,
int nm,
int asize,
int uri,
boolean ne)
Adds an element node to the database.
|
protected abstract void |
addText(byte[] value,
int dist,
byte kind)
Adds a text node to the database.
|
abstract Data |
build()
Builds the database by running the specified parser.
|
abstract void |
close()
Closes open references.
|
void |
comment(byte[] value)
Stores a comment.
|
java.lang.String |
det()
Returns short information on this process.
|
void |
emptyElem(byte[] nm,
Atts att)
Stores an empty element.
|
void |
encoding(java.lang.String enc)
Sets the document encoding.
|
void |
endDoc()
Closes a document node.
|
void |
endElem()
Closes an element.
|
void |
pi(byte[] pi)
Stores a processing instruction.
|
double |
prog()
Returns a progress value (0 - 1).
|
protected abstract void |
setSize(int pre,
int size)
Stores a size value to the specified table position.
|
void |
startDoc(byte[] value)
Opens a document node.
|
void |
startElem(byte[] nm,
Atts att)
Opens a new element node.
|
void |
startNS(byte[] pref,
byte[] uri)
Adds a new namespace; called by the building instance.
|
void |
text(byte[] value)
Stores a text node.
|
protected java.lang.String |
tit()
Returns short information on this process.
|
abort, checkStop, detail, progress, progress, startTimeout, stop, stopTimeout, titlepublic final void startDoc(byte[] value)
throws java.io.IOException
value - document namejava.io.IOException - I/O exceptionpublic final void endDoc()
throws java.io.IOException
java.io.IOException - I/O exceptionpublic final void startNS(byte[] pref,
byte[] uri)
pref - the namespace prefixuri - namespace uripublic final void startElem(byte[] nm,
Atts att)
throws java.io.IOException
nm - tag nameatt - attributesjava.io.IOException - I/O exceptionpublic final void emptyElem(byte[] nm,
Atts att)
throws java.io.IOException
nm - tag nameatt - attributesjava.io.IOException - I/O exceptionpublic final void endElem()
throws java.io.IOException
java.io.IOException - I/O exceptionpublic final void text(byte[] value)
throws java.io.IOException
value - text valuejava.io.IOException - I/O exceptionpublic final void comment(byte[] value)
throws java.io.IOException
value - comment textjava.io.IOException - I/O exceptionpublic final void pi(byte[] pi)
throws java.io.IOException
pi - processing instruction name and valuejava.io.IOException - I/O exceptionpublic final void encoding(java.lang.String enc)
enc - encodingprotected final java.lang.String tit()
Progresspublic final java.lang.String det()
Progresspublic final double prog()
Progresspublic abstract Data build() throws java.io.IOException
java.io.IOException - I/O exceptionpublic abstract void close()
throws java.io.IOException
java.io.IOException - I/O exceptionprotected abstract void addDoc(byte[] value)
throws java.io.IOException
value - name of the documentjava.io.IOException - I/O exceptionprotected abstract void addElem(int dist,
int nm,
int asize,
int uri,
boolean ne)
throws java.io.IOException
setSize(int, int) must
be called to set the final size value.dist - distance to parentnm - the tag name referenceasize - number of attributesuri - namespace uri referencene - namespace flagjava.io.IOException - I/O exceptionprotected abstract void addAttr(int nm,
byte[] value,
int dist,
int uri)
throws java.io.IOException
nm - attribute namevalue - attribute valuedist - distance to parenturi - namespace uri referencejava.io.IOException - I/O exceptionprotected abstract void addText(byte[] value,
int dist,
byte kind)
throws java.io.IOException
value - the token to be added (tag name or content)dist - distance to parentkind - the node kindjava.io.IOException - I/O exceptionprotected abstract void setSize(int pre,
int size)
throws java.io.IOException
pre - pre referencesize - value to be storedjava.io.IOException - I/O exception