public ListProjector(ProjectionList l, Path ctxPath, FieldTreeNode ctx) { super(ctxPath, ctx); List<Projection> projections = l.getItems(); items = new ArrayList<>(projections.size()); for (Projection x : projections) { items.add(Projector.getInstance(x, ctxPath, ctx)); } }
public ListProjector(ProjectionList l, Path ctxPath, FieldTreeNode ctx) { super(ctxPath, ctx); List<Projection> projections = l.getItems(); items = new ArrayList<>(projections.size()); for (Projection x : projections) { items.add(Projector.getInstance(x, ctxPath, ctx)); } }
public ListProjector(ProjectionList l, Path ctxPath, FieldTreeNode ctx) { super(ctxPath, ctx); List<Projection> projections = l.getItems(); items = new ArrayList<>(projections.size()); for (Projection x : projections) { items.add(Projector.getInstance(x, ctxPath, ctx)); } }
/** * Adds two projections and returns a new projection containing both. Any * projection can be null. If the resulting projection is empty, returns * null. */ public static Projection add(Projection p1, Projection p2) { List<Projection> list = new ArrayList<>(); if (p1 instanceof ProjectionList) { list.addAll(((ProjectionList) p1).getItems()); } else if (p1 != null) { list.add(p1); } if (p2 instanceof ProjectionList) { list.addAll(((ProjectionList) p2).getItems()); } else if (p2 != null) { list.add(p2); } return list.isEmpty() ? null : new ProjectionList(list); }
/** * Adds two projections and returns a new projection containing both. Any * projection can be null. If the resulting projection is empty, returns * null. */ public static Projection add(Projection p1, Projection p2) { List<Projection> list = new ArrayList<>(); if (p1 instanceof ProjectionList) { list.addAll(((ProjectionList) p1).getItems()); } else if (p1 != null) { list.add(p1); } if (p2 instanceof ProjectionList) { list.addAll(((ProjectionList) p2).getItems()); } else if (p2 != null) { list.add(p2); } return list.isEmpty() ? null : new ProjectionList(list); }
private Inclusion getFieldInclusion(Path field, ProjectionList p, Path context) { LOGGER.debug("Checking if a projection list projects {}", field); Inclusion lastResult = Inclusion.undecided; List<Projection> items = p.getItems();
private Inclusion getFieldInclusion(Path field, ProjectionList p, Path context) { LOGGER.debug("Checking if a projection list projects {}", field); Inclusion lastResult = Inclusion.undecided; List<Projection> items = p.getItems();
/** * Returns a projection containing the requested projection, all identity * fields, and the objectType field */ private Projection getProjectionFields(Projection requestedProjection, EntityMetadata md) { Field[] identityFields = md.getEntitySchema().getIdentityFields(); List<Projection> projectFields = new ArrayList<>(identityFields == null ? 1 : identityFields.length + 1); if (requestedProjection instanceof ProjectionList) { projectFields.addAll(((ProjectionList) requestedProjection).getItems()); } else if (requestedProjection != null) { projectFields.add(requestedProjection); } if (identityFields != null) { for (Field x : identityFields) { projectFields.add(new FieldProjection(x.getFullPath(), true, false)); } } projectFields.add(new FieldProjection(DocTranslator.OBJECT_TYPE, true, false)); return new ProjectionList(projectFields); }
/** * Returns a projection containing the requested projection, all identity * fields, and the objectType field */ private Projection getProjectionFields(Projection requestedProjection, EntityMetadata md) { Field[] identityFields = md.getEntitySchema().getIdentityFields(); List<Projection> projectFields = new ArrayList<>(identityFields == null ? 1 : identityFields.length + 1); if (requestedProjection instanceof ProjectionList) { projectFields.addAll(((ProjectionList) requestedProjection).getItems()); } else if (requestedProjection != null) { projectFields.add(requestedProjection); } if (identityFields != null) { for (Field x : identityFields) { projectFields.add(new FieldProjection(x.getFullPath(), true, false)); } } projectFields.add(new FieldProjection(Translator.OBJECT_TYPE, true, false)); return new ProjectionList(projectFields); }
return getFieldInclusion(mfield, (ArrayProjection) this, ctx) != Inclusion.undecided; } else if (this instanceof ProjectionList) { for (Projection x : ((ProjectionList) this).getItems()) { if (x.isFieldRequiredToEvaluateProjection(field, ctx)) { return true;
return getFieldInclusion(mfield, (ArrayProjection) this, ctx) != Inclusion.undecided; } else if (this instanceof ProjectionList) { for (Projection x : ((ProjectionList) this).getItems()) { if (x.isFieldRequiredToEvaluateProjection(field, ctx)) { return true;