@Test public void deserializesIntoValueAndCatchesErrors() { NodeMapper mapper = new NodeMapper(); Node node = Node.parse("{\"foo\":true}"); Baz baz = new Baz(); NodeDeserializationException e = Assertions.assertThrows( NodeDeserializationException.class, () -> mapper.deserializeInto(node, baz)); assertThat(e.getMessage(), startsWith( "Deserialization error at (/foo): unable to create java.lang.String from true")); }
public <T> T deserializeInto(Node value, T objectToMutate) { try { DefaultNodeDeserializers.BeanMapper.apply(objectToMutate, value, objectToMutate.getClass(), "", this); return objectToMutate; } catch (ReflectiveOperationException e) { throw createError(objectToMutate.getClass(), "/", value, e.getMessage(), e); } }
NodeMapper { public <T> T deserializeInto(Node value, T objectToMutate) { try { DefaultNodeDeserializers.BeanMapper.apply(objectToMutate, value, objectToMutate.getClass(), "", this); return objectToMutate; } catch (ReflectiveOperationException e) { throw createError(objectToMutate.getClass(), "/", value, e.getMessage(), e); } } }
NodeMapper { public <T> T deserializeInto(Node value, T objectToMutate) { try { DefaultNodeDeserializers.BeanMapper.apply(objectToMutate, value, objectToMutate.getClass(), "", this); return objectToMutate; } catch (ReflectiveOperationException e) { throw createError(objectToMutate.getClass(), "/", value, e.getMessage(), e); } }  }
NodeMapper { public <T> T deserializeInto(Node value, T objectToMutate) { try { DefaultNodeDeserializers.BeanMapper.apply(objectToMutate, value, objectToMutate.getClass(), "", this); return objectToMutate; } catch (ReflectiveOperationException e) { throw createError(objectToMutate.getClass(), "/", value, e.getMessage(), e); } }  void setSerializeNullValues(boolean serializeNullValues); boolean getSerializeNullValues(); void setWhenMissingSetter(WhenMissing whenMissing); WhenMissing getWhenMissingSetter(); void disableToNodeForClass(Class type); void enableToNodeForClass(Class type); Set<Class> getDisableToNode(); void disableFromNodeForClass(Class type); void enableFromNodeForClass(Class type); Set<Class> getDisableFromNode(); boolean getOmitEmptyValues(); void setOmitEmptyValues(boolean omitEmptyValues); Node serialize(Object object); T deserialize(Node value, Class<T> into); T deserializeInto(Node value, T objectToMutate); @SuppressWarnings("unchecked") V deserializeCollection(
            Node value,
            Class<T> into,
            Class<U> members
    ); @SuppressWarnings("unchecked") V deserializeMap(
            Node value, Class<T> into,
            Class<U> members
    ); }
NodeMapper { public <T> T deserializeInto(Node value, T objectToMutate) { try { DefaultNodeDeserializers.BeanMapper.apply(objectToMutate, value, objectToMutate.getClass(), "", this); return objectToMutate; } catch (ReflectiveOperationException e) { throw createError(objectToMutate.getClass(), "/", value, e.getMessage(), e); } }  void setSerializeNullValues(boolean serializeNullValues); boolean getSerializeNullValues(); void setWhenMissingSetter(WhenMissing whenMissing); WhenMissing getWhenMissingSetter(); void disableToNodeForClass(Class type); void enableToNodeForClass(Class type); Set<Class> getDisableToNode(); void disableFromNodeForClass(Class type); void enableFromNodeForClass(Class type); Set<Class> getDisableFromNode(); boolean getOmitEmptyValues(); void setOmitEmptyValues(boolean omitEmptyValues); Node serialize(Object object); T deserialize(Node value, Class<T> into); T deserializeInto(Node value, T objectToMutate); @SuppressWarnings("unchecked") V deserializeCollection(
            Node value,
            Class<T> into,
            Class<U> members
    ); @SuppressWarnings("unchecked") V deserializeMap(
            Node value, Class<T> into,
            Class<U> members
    );  }