java.lang.Object
org.eclipse.yasson.internal.jsonstructure.JsonStructureIterator
org.eclipse.yasson.internal.jsonstructure.JsonArrayIterator
- All Implemented Interfaces:
Iterator<jakarta.json.stream.JsonParser.Event>
Iterates over
JsonArray
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate jakarta.json.JsonValue
private final Iterator<jakarta.json.JsonValue>
-
Constructor Summary
ConstructorsConstructorDescriptionJsonArrayIterator
(jakarta.json.JsonArray jsonArray) Creates new array iterator. -
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.(package private) String
Check the type of currentJsonValue
and return a string representing a value.(package private) jakarta.json.JsonValue
getValue()
Get currentJsonValue
, that the parser is pointing on.boolean
hasNext()
AfterJsonParser.Event
END_ARRAY is returned from next() iterator is removed from the stack.jakarta.json.stream.JsonParser.Event
next()
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
-
valueIterator
-
currentValue
private jakarta.json.JsonValue currentValue
-
-
Constructor Details
-
JsonArrayIterator
public JsonArrayIterator(jakarta.json.JsonArray jsonArray) Creates new array iterator.- Parameters:
jsonArray
- json array
-
-
Method Details
-
hasNext
public boolean hasNext()AfterJsonParser.Event
END_ARRAY is returned from next() iterator is removed from the stack.- Returns:
- always true
-
next
public jakarta.json.stream.JsonParser.Event next() -
getValue
jakarta.json.JsonValue getValue()Description copied from class:JsonStructureIterator
Get currentJsonValue
, that the parser is pointing on.- Specified by:
getValue
in classJsonStructureIterator
- Returns:
- JsonValue result.
-
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.
-
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
-