Skip to content

Commit f0db661

Browse files
committed
implement getArray()
1 parent fa748f3 commit f0db661

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/org/eclipse/yasson/internal/jsonstructure/JsonStructureToParserAdapter.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,13 @@ public JsonObject getObject() {
122122

123123
@Override
124124
public JsonArray getArray() {
125-
throw new UnsupportedOperationException();
125+
JsonStructureIterator current = iterators.peek();
126+
if (current instanceof JsonArrayIterator) {
127+
iterators.pop();
128+
return getValue().asJsonArray();
129+
} else {
130+
throw new JsonbException(Messages.getMessage(MessageKeys.INTERNAL_ERROR, "Outside of array context"));
131+
}
126132
}
127133

128134
private JsonNumber getJsonNumberValue() {

0 commit comments

Comments
 (0)