Package net.minidev.json.writer
Class UpdaterMapper<T>
java.lang.Object
net.minidev.json.writer.JsonReaderI<T>
net.minidev.json.writer.UpdaterMapper<T>
-
Field Summary
Fields inherited from class net.minidev.json.writer.JsonReaderI
base -
Constructor Summary
ConstructorsConstructorDescriptionUpdaterMapper(JsonReader base, T obj) UpdaterMapper(JsonReader base, T obj, Type type) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd a value in an array json object.Allow a mapper to convert a temporary structure to the final data format.use to instantiate a new object that will be used as an arrayuse to instantiate a new object that will be used as an objectvoidcalled 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 keyMethods inherited from class net.minidev.json.writer.JsonReaderI
getType, getValue
-
Constructor Details
-
UpdaterMapper
-
UpdaterMapper
-
-
Method Details
-
startObject
called when json-smart parser meet an object key- Overrides:
startObjectin classJsonReaderI<T>- Parameters:
key- key name- Returns:
- a JsonReaderI to handle the object parsing
- Throws:
ParseException- if parsing failsIOException- if I/O error occurs
-
startArray
called when json-smart parser start an array.- Overrides:
startArrayin classJsonReaderI<T>- Parameters:
key- the destination key name, or null.- Returns:
- a JsonReaderI to handle the array parsing
- Throws:
ParseException- if parsing failsIOException- if I/O error occurs
-
setValue
called when json-smart done parsing a value- Overrides:
setValuein classJsonReaderI<T>- Parameters:
current- the current object being builtkey- the key for the valuevalue- the parsed value- Throws:
ParseException- if parsing failsIOException- if I/O error occurs
-
addValue
add a value in an array json object.- Overrides:
addValuein classJsonReaderI<T>- Parameters:
current- the current array objectvalue- the value to add- Throws:
ParseException- if parsing failsIOException- if I/O error occurs
-
createObject
use to instantiate a new object that will be used as an object- Overrides:
createObjectin classJsonReaderI<T>- Returns:
- a new object instance
-
createArray
use to instantiate a new object that will be used as an array- Overrides:
createArrayin classJsonReaderI<T>- Returns:
- a new array instance
-
convert
Allow a mapper to convert a temporary structure to the final data format.example: convert an List<Integer> to an int[]
- Overrides:
convertin classJsonReaderI<T>- Parameters:
current- the current object to convert- Returns:
- the converted object
-