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 Stringprivate final jakarta.json.JsonObjectprivate JsonObjectIterator.State -
Constructor Summary
Constructors -
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.getKey()Current key this iterator is pointing at.(package private) StringCheck the type of currentJsonValueand return a string representing a value.jakarta.json.JsonValuegetValue()JsonValuefor current key.booleanhasNext()jakarta.json.stream.JsonParser.Eventnext()private voidnextKey()private voidsetState(JsonObjectIterator.State state) 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
-
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()JsonValuefor current key.- Specified by:
getValuein classJsonStructureIterator- Returns:
- Current JsonValue.
-
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
-
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.
-
setState
-
getKey
-