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>

public class JsonObjectIterator extends JsonStructureIterator
Iterates over JsonObject managing internal state.
  • Field Details

  • 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 class JsonStructureIterator
      Returns:
      Current JsonValue.
    • 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
    • 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.
    • setState

      private void setState(JsonObjectIterator.State state)
    • getKey

      public String getKey()
      Current key this iterator is pointing at.
      Returns:
      Current key.