Package net.minidev.json.writer
Class UpdaterMapper<T>
- java.lang.Object
-
- net.minidev.json.writer.JsonReaderI<T>
-
- net.minidev.json.writer.UpdaterMapper<T>
-
public class UpdaterMapper<T> extends JsonReaderI<T>
-
-
Field Summary
-
Fields inherited from class net.minidev.json.writer.JsonReaderI
base
-
-
Constructor Summary
Constructors Constructor Description UpdaterMapper(JsonReader base, T obj)UpdaterMapper(JsonReader base, T obj, Type type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(Object current, Object value)add a value in an array json object.Tconvert(Object current)Allow a mapper to converte a temprary structure to the final data format.ObjectcreateArray()use to instantiate a new object that will be used as an arrayObjectcreateObject()use to instantiate a new object that will be used as an objectvoidsetValue(Object current, String key, Object value)called when json-smart done parsing a valueJsonReaderI<?>startArray(String key)called when json-smart parser start an array.JsonReaderI<?>startObject(String key)called when json-smart parser meet an object key-
Methods inherited from class net.minidev.json.writer.JsonReaderI
getType, getValue
-
-
-
-
Constructor Detail
-
UpdaterMapper
public UpdaterMapper(JsonReader base, T obj)
-
UpdaterMapper
public UpdaterMapper(JsonReader base, T obj, Type type)
-
-
Method Detail
-
startObject
public JsonReaderI<?> startObject(String key) throws ParseException, IOException
called when json-smart parser meet an object key- Overrides:
startObjectin classJsonReaderI<T>- Throws:
ParseExceptionIOException
-
startArray
public JsonReaderI<?> startArray(String key) throws ParseException, IOException
called when json-smart parser start an array.- Overrides:
startArrayin classJsonReaderI<T>- Parameters:
key- the destination key name, or null.- Throws:
ParseExceptionIOException
-
setValue
public void setValue(Object current, String key, Object value) throws ParseException, IOException
called when json-smart done parsing a value- Overrides:
setValuein classJsonReaderI<T>- Throws:
ParseExceptionIOException
-
addValue
public void addValue(Object current, Object value) throws ParseException, IOException
add a value in an array json object.- Overrides:
addValuein classJsonReaderI<T>- Throws:
ParseExceptionIOException
-
createObject
public Object createObject()
use to instantiate a new object that will be used as an object- Overrides:
createObjectin classJsonReaderI<T>
-
createArray
public Object createArray()
use to instantiate a new object that will be used as an array- Overrides:
createArrayin classJsonReaderI<T>
-
convert
public T convert(Object current)
Allow a mapper to converte a temprary structure to the final data format. example: convert an List<Integer> to an int[]- Overrides:
convertin classJsonReaderI<T>
-
-