Json Value Reader
This class reads a JSON document by traversing a Java object comprising maps, lists, and JSON primitives. It does depth-first traversal keeping a stack starting with the root object. During traversal a stack tracks the current position in the document:
- The next element to act upon is on the top of the stack.
- When the top of the stack is a List , calling beginArray replaces the list with a JsonIterator . The first element of the iterator is pushed on top of the iterator.
- Similarly, when the top of the stack is a Map , calling beginObject replaces the map with an JsonIterator of its entries. The first element of the iterator is pushed on top of the iterator.
- When the top of the stack is a Map.Entry , calling nextName returns the entry's key and replaces the entry with its value on the stack.
- When an element is consumed it is popped. If the new top of the stack has a non-exhausted iterator, the next element of that iterator is pushed.
- If the top of the stack is an exhausted iterator, calling endArray or will pop it.
Constructors
JsonValueReader
Link copied to clipboard
JsonValueReader
Link copied to clipboard
Copy-constructor makes a deep copy for peeking.
Types
JsonIterator
Link copied to clipboard
Functions
beginArray
Link copied to clipboard
open fun beginArray()
Content copied to clipboard
beginObject
Link copied to clipboard
open fun beginObject()
Content copied to clipboard
close
Link copied to clipboard
failOnUnknown
Link copied to clipboard
getPath
Link copied to clipboard
isLenient
Link copied to clipboard
nextBoolean
Link copied to clipboard
nextDouble
Link copied to clipboard
nextSource
Link copied to clipboard
nextString
Link copied to clipboard
of
Link copied to clipboard
peek
Link copied to clipboard
peekJson
Link copied to clipboard
promoteNameToValue
Link copied to clipboard
open fun promoteNameToValue()
Content copied to clipboard
readJsonValue
Link copied to clipboard
selectName
Link copied to clipboard
selectString
Link copied to clipboard
setFailOnUnknown
Link copied to clipboard
setLenient
Link copied to clipboard
setTag
Link copied to clipboard
syntaxError
Link copied to clipboard
tag
Link copied to clipboard
typeMismatch
Link copied to clipboard