@Test public void parseArray() throws IOException { ValueArray array = ValueFactory.createArray(3); assertEquals(array, json.filterValue(ValueFactory.create("[]"))); roundTrip(array); array.add(ValueFactory.create(1)); array.add(ValueFactory.create(2)); array.add(ValueFactory.create(3)); assertEquals(array, json.filterValue(ValueFactory.create("[1,2,3]"))); roundTrip(array); array.clear(); array.add(ValueFactory.create("foo")); array.add(ValueFactory.create("bar")); array.add(ValueFactory.create("baz\"quux")); assertEquals(array, json.filterValue(ValueFactory.create("[\"foo\",\"bar\",\"baz\\\"quux\"]"))); roundTrip(array); }
@Nullable @Override public ValueObject filterValue(@Nullable ValueObject value) { try { if (value == null) { return null; } else { return ValueFactory.decodeValue(value.asString().asNative()); } } catch (IOException ex) { throw new UncheckedIOException(ex); } }
ValueFilterJSON extends AbstractValueFilter { @Nullable @Override public ValueObject filterValue(@Nullable ValueObject value) { try { if (value == null) { return null; } else { return ValueFactory.decodeValue(value.asString().asNative()); } } catch (IOException ex) { throw new UncheckedIOException(ex); } } }
ValueFilterJSON extends AbstractValueFilter { @Nullable @Override public ValueObject filterValue(@Nullable ValueObject value) { try { if (value == null) { return null; } else { return ValueFactory.decodeValue(value.asString().asNative()); } } catch (IOException ex) { throw new UncheckedIOException(ex); } }  }
ValueFilterJSON extends AbstractValueFilter { @Nullable @Override public ValueObject filterValue(@Nullable ValueObject value) { try { if (value == null) { return null; } else { return ValueFactory.decodeValue(value.asString().asNative()); } } catch (IOException ex) { throw new UncheckedIOException(ex); } }  @Nullable @Override ValueObject filterValue(@Nullable ValueObject value); }
ValueFilterJSON extends AbstractValueFilter { @Nullable @Override public ValueObject filterValue(@Nullable ValueObject value) { try { if (value == null) { return null; } else { return ValueFactory.decodeValue(value.asString().asNative()); } } catch (IOException ex) { throw new UncheckedIOException(ex); } }  @Nullable @Override ValueObject filterValue(@Nullable ValueObject value);  }