Description
The spec neither javadoc describes what is the parser 'looking at' when passed to user deserializer and if it is scoped in any way, and curent implementations vary in their behavior.
Proposal would be:
Provided JSON Parser will provide user serializer with all events that make up single JSON Value.
For example, when deserializing a JSON Object, the first event returned from parser.next()
will be Event.START_OBJECT
, and then followed by all events until matching Event.END_OBJECT
is reached.
For primitive JSON values (String, Number, boolean literals and null), only single event is offered describing the value is offered to deserializer.
For deserialization of arrays, the first event offered is Event.START_ARRAY
and last is matching Event.END_ARRAY
.