public final class JSONSerializer extends OutputSerializer
JSONConverter class.| Constructor and Description |
|---|
JSONSerializer(java.io.OutputStream os,
SerializerProp props)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
attribute(byte[] name,
byte[] value)
Serializes an attribute.
|
protected void |
code(int ch)
Encode the specified character before printing it.
|
void |
finishAtomic(Item value)
Serializes an item.
|
protected void |
finishClose()
Closes an element.
|
void |
finishComment(byte[] value)
Serializes a comment.
|
protected void |
finishEmpty()
Closes an empty element.
|
protected void |
finishOpen()
Finishes an opening element node.
|
void |
finishPi(byte[] name,
byte[] value)
Serializes a processing instruction.
|
void |
finishText(byte[] text)
Serializes a text.
|
protected void |
startOpen(byte[] name)
Starts an element.
|
close, closeResult, finished, finishText, openResult, resetatomic, closeElement, comment, emptyElement, emptyElement, get, get, namespace, node, node, openElement, openElement, pi, textpublic JSONSerializer(java.io.OutputStream os,
SerializerProp props)
throws java.io.IOException
os - output stream referenceprops - serialization propertiesjava.io.IOException - I/O exceptionprotected void startOpen(byte[] name)
throws java.io.IOException
SerializerstartOpen in class OutputSerializername - tag namejava.io.IOException - I/O exceptionpublic void attribute(byte[] name,
byte[] value)
throws java.io.IOException
Serializerattribute in class OutputSerializername - namevalue - valuejava.io.IOException - I/O exceptionprotected void finishOpen()
throws java.io.IOException
SerializerfinishOpen in class OutputSerializerjava.io.IOException - I/O exceptionpublic void finishText(byte[] text)
throws java.io.IOException
SerializerfinishText in class OutputSerializertext - valuejava.io.IOException - I/O exceptionprotected void finishEmpty()
throws java.io.IOException
SerializerfinishEmpty in class OutputSerializerjava.io.IOException - I/O exceptionprotected void finishClose()
throws java.io.IOException
SerializerfinishClose in class OutputSerializerjava.io.IOException - I/O exceptionprotected void code(int ch)
throws java.io.IOException
OutputSerializerch - character to be encoded and printedjava.io.IOException - I/O exceptionpublic void finishComment(byte[] value)
throws java.io.IOException
SerializerfinishComment in class OutputSerializervalue - valuejava.io.IOException - I/O exceptionpublic void finishPi(byte[] name,
byte[] value)
throws java.io.IOException
SerializerfinishPi in class OutputSerializername - namevalue - valuejava.io.IOException - I/O exceptionpublic void finishAtomic(Item value) throws java.io.IOException
SerializerfinishAtomic in class OutputSerializervalue - itemjava.io.IOException - I/O exception