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>

public class JsonArrayIterator extends JsonStructureIterator
Iterates over JsonArray.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private jakarta.json.JsonValue
     
    private final Iterator<jakarta.json.JsonValue>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    JsonArrayIterator(jakarta.json.JsonArray jsonArray)
    Creates new array iterator.
  • Method Summary

    Modifier and Type
    Method
    Description
    (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 current JsonValue and return a string representing a value.
    (package private) jakarta.json.JsonValue
    Get current JsonValue, that the parser is pointing on.
    boolean
    After JsonParser.Event END_ARRAY is returned from next() iterator is removed from the stack.
    jakarta.json.stream.JsonParser.Event
     

    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

      private final Iterator<jakarta.json.JsonValue> 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()
      After JsonParser.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 current JsonValue, that the parser is pointing on.
      Specified by:
      getValue in class JsonStructureIterator
      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 class JsonStructureIterator
      Returns:
      JsonbException with error description.
    • getString

      String getString()
      Description copied from class: JsonStructureIterator
      Check the type of current JsonValue and return a string representing a value.
      Overrides:
      getString in class JsonStructureIterator
      Returns:
      String value for current JsonValue