|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.io.serial.Serializer
org.basex.io.serial.OutputSerializer
public abstract class OutputSerializer
This class serializes data to an output stream.
Field Summary | |
---|---|
protected boolean |
content
Include content type flag. |
protected int |
ct
Flag for printing content type. |
protected java.lang.String |
docsys
System document type. |
protected boolean |
escape
URI escape flag. |
protected boolean |
html5
HTML5 flag. |
protected int |
indents
Number of spaces to indent. |
protected boolean |
isep
Item separator flag (used for formatting). |
protected byte[] |
nl
New line. |
protected PrintOutput |
out
Output stream. |
protected boolean |
saomit
Standalone 'omit' flag. |
protected boolean |
script
Script flag. |
protected boolean |
sep
Separator flag (used for formatting). |
protected char |
tab
Tabular character. |
Fields inherited from class org.basex.io.serial.Serializer |
---|
elem, indent, level, PROPS, tags, undecl |
Method Summary | |
---|---|
protected void |
atomic(Item it)
Serializes an atomic value. |
protected void |
attribute(byte[] n,
byte[] v)
Serializes an attribute. |
void |
close()
Closes the serializer. |
protected void |
closeResult()
Closes a result. |
protected void |
code(int ch)
Encodes the specified character before printing it. |
protected boolean |
ct(boolean empty,
boolean html)
Prints the content type declaration. |
protected boolean |
doctype(byte[] dt)
Prints the document type declaration. |
protected void |
finishClose()
Closes an element. |
protected void |
finishComment(byte[] n)
Serializes a comment. |
boolean |
finished()
Tests if the serialization was interrupted. |
protected void |
finishEmpty()
Closes an empty element. |
protected void |
finishOpen()
Finishes an opening element node. |
protected void |
finishPi(byte[] n,
byte[] v)
Serializes a processing instruction. |
protected void |
finishText(byte[] b)
Serializes a text. |
protected void |
finishText(byte[] b,
FTPos ftp)
Serializes a text. |
protected void |
hex(int ch)
Returns a hex entity for the specified character. |
protected void |
indent()
Indents the next text. |
protected void |
openDoc(byte[] n)
Opens a document. |
protected void |
openResult()
Starts a result. |
protected void |
print(byte[] token)
Writes a token in the current encoding. |
protected void |
print(int ch)
Writes a character in the current encoding. |
protected void |
print(java.lang.String s)
Writes a string in the current encoding. |
protected void |
printChar(int ch)
Writes a character in the current encoding. |
void |
reset()
Resets the serializer (indentation, etc). |
protected void |
startOpen(byte[] t)
Starts an element. |
Methods inherited from class org.basex.io.serial.Serializer |
---|
closeDoc, closeElement, get, get, namespace, nsUri, serialize, startElement |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String docsys
protected int ct
protected boolean sep
protected boolean isep
protected boolean script
protected final boolean html5
protected final boolean escape
protected final boolean saomit
protected final boolean content
protected final byte[] nl
protected final PrintOutput out
protected final int indents
protected final char tab
Method Detail |
---|
public final void reset()
Serializer
reset
in class Serializer
public void close() throws java.io.IOException
Serializer
close
in class Serializer
java.io.IOException
- I/O exceptionpublic final boolean finished()
Serializer
finished
in class Serializer
protected void openResult() throws java.io.IOException
Serializer
openResult
in class Serializer
java.io.IOException
- I/O exceptionprotected void closeResult() throws java.io.IOException
Serializer
closeResult
in class Serializer
java.io.IOException
- I/O exceptionprotected void attribute(byte[] n, byte[] v) throws java.io.IOException
Serializer
attribute
in class Serializer
n
- namev
- value
java.io.IOException
- I/O exceptionprotected void finishText(byte[] b) throws java.io.IOException
Serializer
finishText
in class Serializer
b
- value
java.io.IOException
- I/O exceptionprotected void finishText(byte[] b, FTPos ftp) throws java.io.IOException
Serializer
finishText
in class Serializer
b
- valueftp
- full-text positions, used for visualization highlighting
java.io.IOException
- I/O exceptionprotected void finishComment(byte[] n) throws java.io.IOException
Serializer
finishComment
in class Serializer
n
- value
java.io.IOException
- I/O exceptionprotected void finishPi(byte[] n, byte[] v) throws java.io.IOException
Serializer
finishPi
in class Serializer
n
- namev
- value
java.io.IOException
- I/O exceptionprotected void atomic(Item it) throws java.io.IOException
Serializer
atomic
in class Serializer
it
- item
java.io.IOException
- I/O exceptionprotected void openDoc(byte[] n) throws java.io.IOException
Serializer
openDoc
in class Serializer
n
- name
java.io.IOException
- I/O exceptionprotected void startOpen(byte[] t) throws java.io.IOException
Serializer
startOpen
in class Serializer
t
- tag name
java.io.IOException
- I/O exceptionprotected void finishOpen() throws java.io.IOException
Serializer
finishOpen
in class Serializer
java.io.IOException
- I/O exceptionprotected void finishEmpty() throws java.io.IOException
Serializer
finishEmpty
in class Serializer
java.io.IOException
- I/O exceptionprotected void finishClose() throws java.io.IOException
Serializer
finishClose
in class Serializer
java.io.IOException
- I/O exceptionprotected void code(int ch) throws java.io.IOException
ch
- character to be encoded and printed
java.io.IOException
- I/O exceptionprotected boolean doctype(byte[] dt) throws java.io.IOException
dt
- document type, or null
for html type
java.io.IOException
- I/O exceptionprotected final void indent() throws java.io.IOException
java.io.IOException
- I/O exceptionprotected final void hex(int ch) throws java.io.IOException
ch
- character
java.io.IOException
- I/O exceptionprotected final void printChar(int ch) throws java.io.IOException
ch
- character to be printed
java.io.IOException
- I/O exceptionprotected void print(int ch) throws java.io.IOException
ch
- character to be printed
java.io.IOException
- I/O exceptionprotected final void print(byte[] token) throws java.io.IOException
token
- token to be printed
java.io.IOException
- I/O exceptionprotected final void print(java.lang.String s) throws java.io.IOException
s
- string to be printed
java.io.IOException
- I/O exceptionprotected boolean ct(boolean empty, boolean html) throws java.io.IOException
empty
- empty flaghtml
- method
true
if declaration was printed
java.io.IOException
- I/O exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |