@Test public void shouldCreateObjectAsIntended() { final IJsonNode result = new ObjectCreation(new ObjectCreation.FieldAssignment("name", new ConstantExpression( TextNode.valueOf("testperson"))), new ObjectCreation.FieldAssignment("age", new ConstantExpression( IntNode.valueOf(30)))).evaluate(IntNode.valueOf(0)); Assert.assertEquals(createObjectNode("name", "testperson", "age", 30), 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; }