@Test public void parseMap() throws IOException { ValueMap map = ValueFactory.createMap(); assertEquals(map, json.filterValue(ValueFactory.create("{}"))); roundTrip(map); map.put("foo", ValueFactory.create(1)); map.put("bar", ValueFactory.create("baz\"quux")); assertEquals(map, json.filterValue(ValueFactory.create("{\"foo\":1,\"bar\":\"baz\\\"quux\"}"))); roundTrip(map); }
@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);  }