@Test public void serializes_During_Deserialization() throws IOException { Object deserializedValue = underTest.deserialize(parser, context); assertThat(deserializedValue, equalTo(FIELD_VALUE)); verify(generator).writeFieldName(eq(FIELD_NAME)); verify(generator).writeObject(eq(FIELD_VALUE)); }
@Override @Nullable public Object deserialize(final JsonParser parser, final DeserializationContext context) throws IOException { String fieldName = parser.getCurrentName(); for (NpmFieldMatcher matcher : matchers) { if (matcher.matches(parser) && matcher.allowDeserializationOnMatched()) { return matcher.getDeserializer().deserialize(fieldName, defaultValueDeserialize(parser, context), parser, context, generator); } } return defaultDeserialize(fieldName, parser, context); }
NpmUntypedObjectDeserializerSerializer extends UntypedObjectDeserializerSerializer { @Override @Nullable public Object deserialize(final JsonParser parser, final DeserializationContext context) throws IOException { String fieldName = parser.getCurrentName(); for (NpmFieldMatcher matcher : matchers) { if (matcher.matches(parser) && matcher.allowDeserializationOnMatched()) { return matcher.getDeserializer().deserialize(fieldName, defaultValueDeserialize(parser, context), parser, context, generator); } } return defaultDeserialize(fieldName, parser, context); } }
NpmUntypedObjectDeserializerSerializer extends UntypedObjectDeserializerSerializer { @Override @Nullable public Object deserialize(final JsonParser parser, final DeserializationContext context) throws IOException { String fieldName = parser.getCurrentName(); for (NpmFieldMatcher matcher : matchers) { if (matcher.matches(parser) && matcher.allowDeserializationOnMatched()) { return matcher.getDeserializer().deserialize(fieldName, defaultValueDeserialize(parser, context), parser, context, generator); } } return defaultDeserialize(fieldName, parser, context); } NpmUntypedObjectDeserializerSerializer(final JsonGenerator generator,
                                                final List<NpmFieldMatcher> matchers); }
NpmUntypedObjectDeserializerSerializer extends UntypedObjectDeserializerSerializer { @Override @Nullable public Object deserialize(final JsonParser parser, final DeserializationContext context) throws IOException { String fieldName = parser.getCurrentName(); for (NpmFieldMatcher matcher : matchers) { if (matcher.matches(parser) && matcher.allowDeserializationOnMatched()) { return matcher.getDeserializer().deserialize(fieldName, defaultValueDeserialize(parser, context), parser, context, generator); } } return defaultDeserialize(fieldName, parser, context); } NpmUntypedObjectDeserializerSerializer(final JsonGenerator generator,
                                                final List<NpmFieldMatcher> matchers); @Override @Nullable Object deserialize(final JsonParser parser, final DeserializationContext context); }
NpmUntypedObjectDeserializerSerializer extends UntypedObjectDeserializerSerializer { @Override @Nullable public Object deserialize(final JsonParser parser, final DeserializationContext context) throws IOException { String fieldName = parser.getCurrentName(); for (NpmFieldMatcher matcher : matchers) { if (matcher.matches(parser) && matcher.allowDeserializationOnMatched()) { return matcher.getDeserializer().deserialize(fieldName, defaultValueDeserialize(parser, context), parser, context, generator); } } return defaultDeserialize(fieldName, parser, context); } NpmUntypedObjectDeserializerSerializer(final JsonGenerator generator,
                                                final List<NpmFieldMatcher> matchers); @Override @Nullable Object deserialize(final JsonParser parser, final DeserializationContext context);  }