|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.data.Serializer
org.basex.data.XMLSerializer
public final class XMLSerializer
This is an interface for serializing XML results.
Field Summary | |
---|---|
static java.lang.String |
INDENT
Indentation. |
PrintOutput |
out
Output stream. |
Fields inherited from class org.basex.data.Serializer |
---|
dn, ns, tags |
Constructor Summary | |
---|---|
XMLSerializer(PrintOutput o)
Constructor. |
|
XMLSerializer(PrintOutput o,
boolean x,
boolean p)
Constructor. |
Method Summary | |
---|---|
void |
attribute(byte[] n,
byte[] v)
Serializes an attribute. |
void |
close(int s)
Finishes the serializer. |
void |
closeResult()
Closes a result. |
void |
comment(byte[] n)
Serializes a comment. |
static byte[] |
content(Data data,
int p,
boolean s)
Returns the content of the current node. |
boolean |
finished()
Tests if the serialization was interrupted. |
void |
indent(boolean close)
Prints the text declaration to the output stream. |
void |
item(byte[] b)
Serializes an item. |
void |
open(int size)
Initializes the serializer. |
void |
openResult()
Starts a result. |
void |
pi(byte[] n,
byte[] v)
Serializes a processing instruction. |
void |
text(byte[] b)
Serializes a text. |
Methods inherited from class org.basex.data.Serializer |
---|
closeElement, emptyElement, emptyElement, emptyElement, finishElement, namespace, node, openElement, openElement, pi, startElement, startElement |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String INDENT
public final PrintOutput out
Constructor Detail |
---|
public XMLSerializer(PrintOutput o)
o
- output streampublic XMLSerializer(PrintOutput o, boolean x, boolean p)
o
- output streamx
- xml outputp
- pretty printingMethod Detail |
---|
public void open(int size) throws java.io.IOException
Serializer
open
in class Serializer
size
- number of results
java.io.IOException
- exceptionpublic void close(int s) throws java.io.IOException
Serializer
close
in class Serializer
s
- number of results
java.io.IOException
- exceptionpublic void openResult() throws java.io.IOException
Serializer
openResult
in class Serializer
java.io.IOException
- exceptionpublic void closeResult() throws java.io.IOException
Serializer
closeResult
in class Serializer
java.io.IOException
- exceptionpublic void attribute(byte[] n, byte[] v) throws java.io.IOException
Serializer
attribute
in class Serializer
n
- namev
- value
java.io.IOException
- exceptionpublic void text(byte[] b) throws java.io.IOException
Serializer
text
in class Serializer
b
- text bytes
java.io.IOException
- exceptionpublic void comment(byte[] n) throws java.io.IOException
Serializer
comment
in class Serializer
n
- comment
java.io.IOException
- exceptionpublic void pi(byte[] n, byte[] v) throws java.io.IOException
Serializer
pi
in class Serializer
n
- namev
- value
java.io.IOException
- exceptionpublic void item(byte[] b) throws java.io.IOException
Serializer
item
in class Serializer
b
- text bytes
java.io.IOException
- exceptionpublic boolean finished()
Serializer
finished
in class Serializer
public void indent(boolean close) throws java.io.IOException
close
- close flag
java.io.IOException
- in case of problems with the PrintOutputpublic static byte[] content(Data data, int p, boolean s)
data
- data referencep
- pre values
- short representation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |