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 |
atomic(Item value)
Serializes an atomic value.
|
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.
|
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, ct, doctype, finished, finishText, hex, indent, openDoc, openResult, print, print, print, printChar, resetcloseDoc, closeElement, get, get, namespace, serialize, serialize, startElementpublic 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
OutputSerializercode in class 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 atomic(Item value) throws java.io.IOException
Serializeratomic in class OutputSerializervalue - itemjava.io.IOException - I/O exception