Module org.eclipse.yasson
Class JsonObjectIterator
java.lang.Object
org.eclipse.yasson.internal.jsonstructure.JsonStructureIterator
org.eclipse.yasson.internal.jsonstructure.JsonObjectIterator
- All Implemented Interfaces:
Iterator<jakarta.json.stream.JsonParser.Event>
Iterates over
JsonObject
managing internal state.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private final jakarta.json.JsonObject
private JsonObjectIterator.State
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) jakarta.json.bind.JsonbException
Creates an exception for throwing in case of current value type is not compatible with called getter return type.getKey()
Current key this iterator is pointing at.(package private) String
Check the type of currentJsonValue
and return a string representing a value.jakarta.json.JsonValue
getValue()
JsonValue
for current key.boolean
hasNext()
jakarta.json.stream.JsonParser.Event
next()
private void
nextKey()
private void
setState
(JsonObjectIterator.State state) Methods inherited from class org.eclipse.yasson.internal.jsonstructure.JsonStructureIterator
getValueEvent
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Field Details
-
jsonObject
private final jakarta.json.JsonObject jsonObject -
keyIterator
-
currentKey
-
state
-
-
Constructor Details
-
JsonObjectIterator
JsonObjectIterator(jakarta.json.JsonObject jsonObject)
-
-
Method Details
-
nextKey
private void nextKey() -
next
public jakarta.json.stream.JsonParser.Event next() -
hasNext
public boolean hasNext() -
getValue
public jakarta.json.JsonValue getValue()JsonValue
for current key.- Specified by:
getValue
in classJsonStructureIterator
- Returns:
- Current JsonValue.
-
getString
String getString()Description copied from class:JsonStructureIterator
Check the type of currentJsonValue
and return a string representing a value.- Overrides:
getString
in classJsonStructureIterator
- Returns:
- String value for current JsonValue
-
createIncompatibleValueError
jakarta.json.bind.JsonbException createIncompatibleValueError()Description copied from class:JsonStructureIterator
Creates an exception for throwing in case of current value type is not compatible with called getter return type.- Specified by:
createIncompatibleValueError
in classJsonStructureIterator
- Returns:
- JsonbException with error description.
-
setState
-
getKey
Current key this iterator is pointing at.- Returns:
- Current key.
-