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_isObjprivate JSONStylecompressionprivate booleanisClosedprivate booleanisOpenprivate booleanneedSepprivate java.lang.Appendableout-
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 voidaddComma()voidaddValue(java.lang.Object current, java.lang.Object value)add a value in an array json object.private voidclose(java.lang.Object obj)CompessorMapperconvert(java.lang.Object current)Allow a mapper to converte a temprary structure to the final data format.java.lang.ObjectcreateArray()use to instantiate a new object that will be used as an arrayjava.lang.ObjectcreateObject()use to instantiate a new object that will be used as an objectprivate booleanisArray()private booleanisCompressor(java.lang.Object obj)private booleanisObject()private voidopen(java.lang.Object obj)voidsetValue(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 voidstartKey(java.lang.String key)JsonReaderI<?>startObject(java.lang.String key)called when json-smart parser meet an object keyprivate voidwriteValue(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:JsonReaderIcalled when json-smart parser meet an object key- Overrides:
startObjectin classJsonReaderI<CompessorMapper>- Throws:
java.io.IOException
-
startArray
public JsonReaderI<?> startArray(java.lang.String key) throws java.io.IOException
Description copied from class:JsonReaderIcalled when json-smart parser start an array.- Overrides:
startArrayin 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.IOExceptionDescription copied from class:JsonReaderIcalled when json-smart done parsing a value- Overrides:
setValuein classJsonReaderI<CompessorMapper>- Throws:
java.io.IOException
-
addValue
public void addValue(java.lang.Object current, java.lang.Object value) throws java.io.IOExceptionDescription copied from class:JsonReaderIadd a value in an array json object.- Overrides:
addValuein 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:JsonReaderIuse to instantiate a new object that will be used as an object- Overrides:
createObjectin classJsonReaderI<CompessorMapper>
-
createArray
public java.lang.Object createArray()
Description copied from class:JsonReaderIuse to instantiate a new object that will be used as an array- Overrides:
createArrayin classJsonReaderI<CompessorMapper>
-
convert
public CompessorMapper convert(java.lang.Object current)
Description copied from class:JsonReaderIAllow a mapper to converte a temprary structure to the final data format. example: convert an Listto an int[] - Overrides:
convertin 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
-
-