@Test public void projection_list() throws Exception { String pr = "[{'field':'field6.*','include':1},{'field':'field5'}]"; Projector projector = projector(pr, md); JsonNode expectedNode = JsonUtils.json("{'field5':true,'field6':{'nf1':'nvalue1','nf2':'nvalue2','nf3':4,'nf4':false,'nf11':null}}".replace('\'', '\"')); JsonDoc newDoc = projector.project(doc, factory); Assert.assertEquals(expectedNode.toString(), newDoc.toString()); }
@Override public Projection.Inclusion project(Path p, QueryEvaluationContext ctx) { nestedProjector = null; ListIterator<Projector> itemsItr = items.listIterator(items.size()); while (itemsItr.hasPrevious()) { Projector projector = itemsItr.previous(); Projection.Inclusion projectionResult = projector.project(p, ctx); if (projectionResult != Projection.Inclusion.undecided) { nestedProjector = projector.getNestedProjector(); return projectionResult; } } return Projection.Inclusion.undecided; }
ListProjector extends Projector { @Override public Projection.Inclusion project(Path p, QueryEvaluationContext ctx) { nestedProjector = null; ListIterator<Projector> itemsItr = items.listIterator(items.size()); while (itemsItr.hasPrevious()) { Projector projector = itemsItr.previous(); Projection.Inclusion projectionResult = projector.project(p, ctx); if (projectionResult != Projection.Inclusion.undecided) { nestedProjector = projector.getNestedProjector(); return projectionResult; } } return Projection.Inclusion.undecided; } }
ListProjector extends Projector { @Override public Projection.Inclusion project(Path p, QueryEvaluationContext ctx) { nestedProjector = null; ListIterator<Projector> itemsItr = items.listIterator(items.size()); while (itemsItr.hasPrevious()) { Projector projector = itemsItr.previous(); Projection.Inclusion projectionResult = projector.project(p, ctx); if (projectionResult != Projection.Inclusion.undecided) { nestedProjector = projector.getNestedProjector(); return projectionResult; } } return Projection.Inclusion.undecided; } ListProjector(ProjectionList l, Path ctxPath, FieldTreeNode ctx); }
ListProjector extends Projector { @Override public Projection.Inclusion project(Path p, QueryEvaluationContext ctx) { nestedProjector = null; ListIterator<Projector> itemsItr = items.listIterator(items.size()); while (itemsItr.hasPrevious()) { Projector projector = itemsItr.previous(); Projection.Inclusion projectionResult = projector.project(p, ctx); if (projectionResult != Projection.Inclusion.undecided) { nestedProjector = projector.getNestedProjector(); return projectionResult; } } return Projection.Inclusion.undecided; } ListProjector(ProjectionList l, Path ctxPath, FieldTreeNode ctx); @Override Projector getNestedProjector(); List<Projector> getItems(); @Override Projection.Inclusion project(Path p, QueryEvaluationContext ctx); }
ListProjector extends Projector { @Override public Projection.Inclusion project(Path p, QueryEvaluationContext ctx) { nestedProjector = null; ListIterator<Projector> itemsItr = items.listIterator(items.size()); while (itemsItr.hasPrevious()) { Projector projector = itemsItr.previous(); Projection.Inclusion projectionResult = projector.project(p, ctx); if (projectionResult != Projection.Inclusion.undecided) { nestedProjector = projector.getNestedProjector(); return projectionResult; } } return Projection.Inclusion.undecided; } ListProjector(ProjectionList l, Path ctxPath, FieldTreeNode ctx); @Override Projector getNestedProjector(); List<Projector> getItems(); @Override Projection.Inclusion project(Path p, QueryEvaluationContext ctx);  }