Class JsonArrayIterator
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.JsonValueprivate 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.JsonbExceptionCreates an exception for throwing in case of current value type is not compatible with called getter return type.(package private) StringCheck the type of currentJsonValueand return a string representing a value.(package private) jakarta.json.JsonValuegetValue()Get currentJsonValue, that the parser is pointing on.booleanhasNext()AfterJsonParser.EventEND_ARRAY is returned from next() iterator is removed from the stack.jakarta.json.stream.JsonParser.Eventnext()Methods inherited from class JsonStructureIterator
getValueEventMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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.EventEND_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:JsonStructureIteratorGet currentJsonValue, that the parser is pointing on.- Specified by:
getValuein classJsonStructureIterator- Returns:
- JsonValue result.
-
createIncompatibleValueError
jakarta.json.bind.JsonbException createIncompatibleValueError()Description copied from class:JsonStructureIteratorCreates an exception for throwing in case of current value type is not compatible with called getter return type.- Specified by:
createIncompatibleValueErrorin classJsonStructureIterator- Returns:
- JsonbException with error description.
-
getString
String getString()Description copied from class:JsonStructureIteratorCheck the type of currentJsonValueand return a string representing a value.- Overrides:
getStringin classJsonStructureIterator- Returns:
- String value for current JsonValue
-