public abstract class Builder extends Proc
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 name,
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 name,
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.
|
abstract void |
close()
Closes open references.
|
void |
closeDoc()
Closes a document node.
|
void |
closeElem()
Closes an element.
|
void |
comment(byte[] value)
Stores a comment.
|
abstract DataClip |
dataClip()
Returns a data clip with the parsed input.
|
String |
det()
Returns short information on this process.
|
void |
emptyElem(byte[] name,
Atts att,
Atts nsp)
Stores an empty element.
|
void |
encoding(String encoding)
Sets the document encoding.
|
void |
openDoc(byte[] value)
Opens a document node.
|
void |
openElem(byte[] name,
Atts att,
Atts nsp)
Opens a new element node.
|
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 |
text(byte[] value)
Stores a text node.
|
protected String |
tit()
Returns short information on this process.
|
abort, checkStop, databases, detail, listen, proc, progress, registered, registered, startTimeout, stop, stopTimeout, title
public final void openDoc(byte[] value) throws IOException
value
- document nameIOException
- I/O exceptionpublic final void closeDoc() throws IOException
IOException
- I/O exceptionpublic final void openElem(byte[] name, Atts att, Atts nsp) throws IOException
name
- name of elementatt
- attributesnsp
- namespacesIOException
- I/O exceptionpublic final void emptyElem(byte[] name, Atts att, Atts nsp) throws IOException
name
- name of elementatt
- attributesnsp
- namespacesIOException
- I/O exceptionpublic final void closeElem() throws IOException
IOException
- I/O exceptionpublic final void text(byte[] value) throws IOException
value
- text valueIOException
- I/O exceptionpublic final void comment(byte[] value) throws IOException
value
- comment textIOException
- I/O exceptionpublic final void pi(byte[] pi) throws IOException
pi
- processing instruction name and valueIOException
- I/O exceptionpublic final void encoding(String encoding)
encoding
- encodingprotected final String tit()
Proc
public final String det()
Proc
public final double prog()
Proc
public abstract Data build() throws IOException
IOException
- I/O exceptionpublic abstract DataClip dataClip() throws IOException
IOException
- I/O exceptionpublic abstract void close() throws IOException
IOException
- I/O exceptionprotected abstract void addDoc(byte[] value) throws IOException
value
- name of the documentIOException
- I/O exceptionprotected abstract void addElem(int dist, int name, int asize, int uri, boolean ne) throws IOException
setSize(int, int)
must
be called to set the final size value.dist
- distance to parentname
- element nameasize
- number of attributesuri
- namespace uri referencene
- namespace flagIOException
- I/O exceptionprotected abstract void addAttr(int name, byte[] value, int dist, int uri) throws IOException
name
- attribute namevalue
- attribute valuedist
- distance to parenturi
- namespace uri referenceIOException
- I/O exceptionprotected abstract void addText(byte[] value, int dist, byte kind) throws IOException
value
- the token to be addeddist
- distance to parentkind
- the node kindIOException
- I/O exceptionprotected abstract void setSize(int pre, int size) throws IOException
pre
- pre referencesize
- value to be storedIOException
- I/O exceptionCopyright © 2005–2015 BaseX Team. All rights reserved.