@Test public void shouldEvaluateMappings() { final ObjectCreation.FieldAssignment mapping = new ObjectCreation.FieldAssignment("testname", new InputSelection(0)); final ObjectNode result = createObjectNode("fieldname", "test"); mapping.evaluate(createArrayNode("1", "2"), result); mapping.evaluate(createArrayNode("3", "4"), result); Assert.assertEquals(createObjectNode("fieldname", "test", "testname", "3"), result); }
@Override public IJsonNode evaluate(final IJsonNode node) { this.result.clear(); for (final Mapping<?> mapping : this.mappings) mapping.evaluate(node, this.result); return this.result; }
ObjectCreation extends EvaluationExpression { @Override public IJsonNode evaluate(final IJsonNode node) { this.result.clear(); for (final Mapping<?> mapping : this.mappings) mapping.evaluate(node, this.result); return this.result; } }
ObjectCreation extends EvaluationExpression { @Override public IJsonNode evaluate(final IJsonNode node) { this.result.clear(); for (final Mapping<?> mapping : this.mappings) mapping.evaluate(node, this.result); return this.result; } ObjectCreation();  ObjectCreation(final Mapping<?>... mappings);  ObjectCreation(final List<Mapping<?>> mappings); }
ObjectCreation extends EvaluationExpression { @Override public IJsonNode evaluate(final IJsonNode node) { this.result.clear(); for (final Mapping<?> mapping : this.mappings) mapping.evaluate(node, this.result); return this.result; } ObjectCreation();  ObjectCreation(final Mapping<?>... mappings);  ObjectCreation(final List<Mapping<?>> mappings); ObjectCreation addMapping(final Mapping<?> mapping); ObjectCreation addMapping(final PathSegmentExpression target, final EvaluationExpression expression); ObjectCreation addMapping(final String target, final EvaluationExpression expression); @Override void appendAsString(final Appendable appendable); @Override boolean equals(final Object obj); @Override IJsonNode evaluate(final IJsonNode node); Mapping<?> getMapping(final int index); List<Mapping<?>> getMappings(); int getMappingSize(); @Override int hashCode(); @Override ChildIterator iterator(); }
ObjectCreation extends EvaluationExpression { @Override public IJsonNode evaluate(final IJsonNode node) { this.result.clear(); for (final Mapping<?> mapping : this.mappings) mapping.evaluate(node, this.result); return this.result; } ObjectCreation();  ObjectCreation(final Mapping<?>... mappings);  ObjectCreation(final List<Mapping<?>> mappings); ObjectCreation addMapping(final Mapping<?> mapping); ObjectCreation addMapping(final PathSegmentExpression target, final EvaluationExpression expression); ObjectCreation addMapping(final String target, final EvaluationExpression expression); @Override void appendAsString(final Appendable appendable); @Override boolean equals(final Object obj); @Override IJsonNode evaluate(final IJsonNode node); Mapping<?> getMapping(final int index); List<Mapping<?>> getMappings(); int getMappingSize(); @Override int hashCode(); @Override ChildIterator iterator(); static final ObjectCreation CONCATENATION; }