public class StreamJsonSerializer extends java.lang.Object implements JsonStructureCallback
Modifier and Type | Field and Description |
---|---|
private com.fasterxml.jackson.core.JsonGenerator |
gen
Jackson json generator
|
Constructor and Description |
---|
StreamJsonSerializer(java.io.OutputStream out,
com.fasterxml.jackson.core.JsonEncoding encoding,
boolean pretty)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
booleanValue(boolean value)
Called when json boolean value is encountered.
|
void |
closeStream()
Close the stream.
|
void |
endArray()
Called when json array end is encountered.
|
void |
endObject()
Called when json object end is encountered.
|
void |
fieldName(java.lang.String name)
Called when json field is encountered.
|
void |
nullValue()
Called when json null value is encountered.
|
void |
numberValue(java.lang.Number value)
Called when json number value is encountered.
|
void |
rawDecimalValue(java.lang.String value)
Called when json raw decimal value is encountered.
|
void |
startArray()
Called when json array start is encountered.
|
void |
startObject()
Called when json object start is encountered.
|
void |
stringValue(java.lang.String value)
Called when json string value is encountered.
|
public StreamJsonSerializer(java.io.OutputStream out, com.fasterxml.jackson.core.JsonEncoding encoding, boolean pretty) throws java.io.IOException
out
- Output stream.encoding
- Character encoding.pretty
- Pretty print flag.java.io.IOException
- when IO error occurs.public void closeStream() throws java.io.IOException
java.io.IOException
- when IO error occurs.public void startObject()
startObject
in interface JsonStructureCallback
public void endObject()
endObject
in interface JsonStructureCallback
public void startArray()
startArray
in interface JsonStructureCallback
public void endArray()
endArray
in interface JsonStructureCallback
public void fieldName(java.lang.String name)
fieldName
in interface JsonStructureCallback
name
- Field name.public void booleanValue(boolean value)
booleanValue
in interface JsonStructureCallback
value
- The value.public void stringValue(java.lang.String value)
stringValue
in interface JsonStructureCallback
value
- The value.public void numberValue(java.lang.Number value)
numberValue
in interface JsonStructureCallback
value
- The value.public void nullValue()
nullValue
in interface JsonStructureCallback
public void rawDecimalValue(java.lang.String value)
rawDecimalValue
in interface JsonStructureCallback
value
- The value.