Package net.minidev.json.writer
Class CompessorMapper
- java.lang.Object
-
- net.minidev.json.writer.JsonReaderI<CompessorMapper>
-
- net.minidev.json.writer.CompessorMapper
-
public class CompessorMapper extends JsonReaderI<CompessorMapper>
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Boolean
_isObj
private JSONStyle
compression
private boolean
isClosed
private boolean
isOpen
private boolean
needSep
private java.lang.Appendable
out
-
Fields inherited from class net.minidev.json.writer.JsonReaderI
base
-
-
Constructor Summary
Constructors Constructor Description CompessorMapper(JsonReader base, java.lang.Appendable out, JSONStyle compression)
CompessorMapper(JsonReader base, java.lang.Appendable out, JSONStyle compression, java.lang.Boolean isObj)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addComma()
void
addValue(java.lang.Object current, java.lang.Object value)
add a value in an array json object.private void
close(java.lang.Object obj)
CompessorMapper
convert(java.lang.Object current)
Allow a mapper to converte a temprary structure to the final data format.java.lang.Object
createArray()
use to instantiate a new object that will be used as an arrayjava.lang.Object
createObject()
use to instantiate a new object that will be used as an objectprivate boolean
isArray()
private boolean
isCompressor(java.lang.Object obj)
private boolean
isObject()
private void
open(java.lang.Object obj)
void
setValue(java.lang.Object current, java.lang.String key, java.lang.Object value)
called when json-smart done parsing a valueJsonReaderI<?>
startArray(java.lang.String key)
called when json-smart parser start an array.private void
startKey(java.lang.String key)
JsonReaderI<?>
startObject(java.lang.String key)
called when json-smart parser meet an object keyprivate void
writeValue(java.lang.Object value)
-
Methods inherited from class net.minidev.json.writer.JsonReaderI
getType, getValue
-
-
-
-
Field Detail
-
out
private java.lang.Appendable out
-
compression
private JSONStyle compression
-
_isObj
private java.lang.Boolean _isObj
-
needSep
private boolean needSep
-
isOpen
private boolean isOpen
-
isClosed
private boolean isClosed
-
-
Constructor Detail
-
CompessorMapper
public CompessorMapper(JsonReader base, java.lang.Appendable out, JSONStyle compression)
-
CompessorMapper
public CompessorMapper(JsonReader base, java.lang.Appendable out, JSONStyle compression, java.lang.Boolean isObj)
-
-
Method Detail
-
isArray
private boolean isArray()
-
isObject
private boolean isObject()
-
isCompressor
private boolean isCompressor(java.lang.Object obj)
-
startObject
public JsonReaderI<?> startObject(java.lang.String key) throws java.io.IOException
Description copied from class:JsonReaderI
called when json-smart parser meet an object key- Overrides:
startObject
in classJsonReaderI<CompessorMapper>
- Throws:
java.io.IOException
-
startArray
public JsonReaderI<?> startArray(java.lang.String key) throws java.io.IOException
Description copied from class:JsonReaderI
called when json-smart parser start an array.- Overrides:
startArray
in classJsonReaderI<CompessorMapper>
- Parameters:
key
- the destination key name, or null.- Throws:
java.io.IOException
-
startKey
private void startKey(java.lang.String key) throws java.io.IOException
- Throws:
java.io.IOException
-
setValue
public void setValue(java.lang.Object current, java.lang.String key, java.lang.Object value) throws java.io.IOException
Description copied from class:JsonReaderI
called when json-smart done parsing a value- Overrides:
setValue
in classJsonReaderI<CompessorMapper>
- Throws:
java.io.IOException
-
addValue
public void addValue(java.lang.Object current, java.lang.Object value) throws java.io.IOException
Description copied from class:JsonReaderI
add a value in an array json object.- Overrides:
addValue
in classJsonReaderI<CompessorMapper>
- Throws:
java.io.IOException
-
addComma
private void addComma() throws java.io.IOException
- Throws:
java.io.IOException
-
writeValue
private void writeValue(java.lang.Object value) throws java.io.IOException
- Throws:
java.io.IOException
-
createObject
public java.lang.Object createObject()
Description copied from class:JsonReaderI
use to instantiate a new object that will be used as an object- Overrides:
createObject
in classJsonReaderI<CompessorMapper>
-
createArray
public java.lang.Object createArray()
Description copied from class:JsonReaderI
use to instantiate a new object that will be used as an array- Overrides:
createArray
in classJsonReaderI<CompessorMapper>
-
convert
public CompessorMapper convert(java.lang.Object current)
Description copied from class:JsonReaderI
Allow a mapper to converte a temprary structure to the final data format. example: convert an Listto an int[] - Overrides:
convert
in classJsonReaderI<CompessorMapper>
-
close
private void close(java.lang.Object obj) throws java.io.IOException
- Throws:
java.io.IOException
-
open
private void open(java.lang.Object obj) throws java.io.IOException
- Throws:
java.io.IOException
-
-