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 void
addValue(Object current, Object value)
add a value in an array json object.T
convert(Object current)
Allow a mapper to convert a temporary structure to the final data format.Object
createArray()
use to instantiate a new object that will be used as an arrayObject
createObject()
use to instantiate a new object that will be used as an objectvoid
setValue(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:
startObject
in classJsonReaderI<T>
- Parameters:
key
- key name- Throws:
ParseException
IOException
-
startArray
public JsonReaderI<?> startArray(String key) throws ParseException, IOException
called when json-smart parser start an array.- Overrides:
startArray
in classJsonReaderI<T>
- Parameters:
key
- the destination key name, or null.- Throws:
ParseException
IOException
-
setValue
public void setValue(Object current, String key, Object value) throws ParseException, IOException
called when json-smart done parsing a value- Overrides:
setValue
in classJsonReaderI<T>
- Throws:
ParseException
IOException
-
addValue
public void addValue(Object current, Object value) throws ParseException, IOException
add a value in an array json object.- Overrides:
addValue
in classJsonReaderI<T>
- Throws:
ParseException
IOException
-
createObject
public Object createObject()
use to instantiate a new object that will be used as an object- Overrides:
createObject
in classJsonReaderI<T>
-
createArray
public Object createArray()
use to instantiate a new object that will be used as an array- Overrides:
createArray
in classJsonReaderI<T>
-
convert
public T convert(Object current)
Allow a mapper to convert a temporary structure to the final data format. example: convert an List<Integer> to an int[]- Overrides:
convert
in classJsonReaderI<T>
-
-