|
||||||||||
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
org.basex.io.serial.JSONSerializer
public final class JSONSerializer
This class serializes data as JSON. The input must conform to the rules
defined in the JsonCGConverter
class.
Field Summary |
---|
Fields inherited from class org.basex.io.serial.OutputSerializer |
---|
content, ct, docsys, escape, html5, indents, isep, nl, out, saomit, script, sep, tab |
Fields inherited from class org.basex.io.serial.Serializer |
---|
elem, indent, level, PROPS, tags, undecl |
Constructor Summary | |
---|---|
JSONSerializer(java.io.OutputStream os,
SerializerProp props)
Constructor. |
Method Summary | |
---|---|
protected void |
atomic(Item value)
Serializes an atomic value. |
protected void |
attribute(byte[] name,
byte[] value)
Serializes an attribute. |
protected void |
code(int ch)
Encodes the specified character before printing it. |
protected void |
finishClose()
Closes an element. |
protected void |
finishComment(byte[] value)
Serializes a comment. |
protected void |
finishEmpty()
Closes an empty element. |
protected void |
finishOpen()
Finishes an opening element node. |
protected void |
finishPi(byte[] name,
byte[] value)
Serializes a processing instruction. |
protected void |
finishText(byte[] text)
Serializes a text. |
protected void |
startOpen(byte[] name)
Starts an element. |
Methods inherited from class org.basex.io.serial.OutputSerializer |
---|
close, closeResult, ct, doctype, finished, finishText, hex, indent, openDoc, openResult, print, print, print, printChar, reset |
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 |
Constructor Detail |
---|
public JSONSerializer(java.io.OutputStream os, SerializerProp props) throws java.io.IOException
os
- output stream referenceprops
- serialization properties
java.io.IOException
- I/O exceptionMethod Detail |
---|
protected void startOpen(byte[] name) throws java.io.IOException
Serializer
startOpen
in class OutputSerializer
name
- tag name
java.io.IOException
- I/O exceptionprotected void attribute(byte[] name, byte[] value) throws java.io.IOException
Serializer
attribute
in class OutputSerializer
name
- namevalue
- value
java.io.IOException
- I/O exceptionprotected void finishOpen() throws java.io.IOException
Serializer
finishOpen
in class OutputSerializer
java.io.IOException
- I/O exceptionprotected void finishText(byte[] text) throws java.io.IOException
Serializer
finishText
in class OutputSerializer
text
- value
java.io.IOException
- I/O exceptionprotected void finishEmpty() throws java.io.IOException
Serializer
finishEmpty
in class OutputSerializer
java.io.IOException
- I/O exceptionprotected void finishClose() throws java.io.IOException
Serializer
finishClose
in class OutputSerializer
java.io.IOException
- I/O exceptionprotected void code(int ch) throws java.io.IOException
OutputSerializer
code
in class OutputSerializer
ch
- character to be encoded and printed
java.io.IOException
- I/O exceptionprotected void finishComment(byte[] value) throws java.io.IOException
Serializer
finishComment
in class OutputSerializer
value
- value
java.io.IOException
- I/O exceptionprotected void finishPi(byte[] name, byte[] value) throws java.io.IOException
Serializer
finishPi
in class OutputSerializer
name
- namevalue
- value
java.io.IOException
- I/O exceptionprotected void atomic(Item value) throws java.io.IOException
Serializer
atomic
in class OutputSerializer
value
- item
java.io.IOException
- I/O exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |