Package net.minidev.json.writer
Class JsonReaderI<T>
java.lang.Object
net.minidev.json.writer.JsonReaderI<T>
- Type Parameters:
T- result type
- Direct Known Subclasses:
ArraysMapper,BeansMapper,BeansMapper.Bean,BeansMapper.BeanNoConv,CollectionMapper.ListClass,CollectionMapper.ListType,CollectionMapper.MapClass,CollectionMapper.MapType,CompessorMapper,DefaultMapper,DefaultMapperCollection,DefaultMapperOrdered,FakeMapper,MapperRemapped,UpdaterMapper
Default datatype mapper use by Json-smart ton store data.
- Author:
- uriel Chemouni
-
Field Summary
Fields -
Constructor Summary
Constructors -
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 objectGets the type for the specified keyGets a value from the current 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 key
-
Field Details
-
base
-
-
Constructor Details
-
JsonReaderI
Reader can be link to the JsonReader Base- Parameters:
base- parent reader
-
-
Method Details
-
startObject
called when json-smart parser meet an object key- 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.- 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- 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
-
getValue
Gets a value from the current object- Parameters:
current- the current objectkey- the key to get the value for- Returns:
- the value associated with the key
-
getType
Gets the type for the specified key- Parameters:
key- the key to get the type for- Returns:
- the Type associated with the key
-
addValue
add a value in an array json object.- 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- Returns:
- a new object instance
-
createArray
use to instantiate a new object that will be used as an array- 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[]
- Parameters:
current- the current object to convert- Returns:
- the converted object
-