@Override protected Boolean projectArray(Path p, QueryEvaluationContext ctx) { Path contextRoot = ctx.getPath(); QueryEvaluationContext nestedContext = ctx.getNestedContext(contextRoot.isEmpty() ? p : p.suffix(-contextRoot.numSegments())); if (query.evaluate(nestedContext)) { setLastMatch(true); return isIncluded() ? Boolean.TRUE : Boolean.FALSE; } return null; } }
/** * Builds a (potentially nested) projection based on the given projection, * and the location in the metadata field tree. */ public static Projector getInstance(Projection projection, Path ctxPath, FieldTreeNode ctx) { if (projection instanceof FieldProjection) { return new FieldProjector((FieldProjection) projection, ctxPath, ctx); } else if (projection instanceof ProjectionList) { return new ListProjector((ProjectionList) projection, ctxPath, ctx); } else if (projection instanceof ArrayRangeProjection) { return new ArrayRangeProjector((ArrayRangeProjection) projection, ctxPath, ctx); } else { return new ArrayQueryProjector((ArrayQueryMatchProjection) projection, ctxPath, ctx); } }
@Override protected Projection.Inclusion projectArray(Path p, QueryEvaluationContext ctx) { LOGGER.debug("Evaluating array query projection for {}", p); Path contextRoot = ctx.getPath(); QueryEvaluationContext nestedContext = ctx.getNestedContext(contextRoot.isEmpty() ? p : p.suffix(-contextRoot.numSegments())); if (query.evaluate(nestedContext)) { LOGGER.debug("query evaluates to true"); return isIncluded() ? Projection.Inclusion.explicit_inclusion : Projection.Inclusion.explicit_exclusion; } return isIncluded() ? Projection.Inclusion.explicit_exclusion : Projection.Inclusion.explicit_inclusion; } }
/** * Builds a (potentially nested) projection based on the given projection, * and the location in the metadata field tree. */ public static Projector getInstance(Projection projection, Path ctxPath, FieldTreeNode ctx) { if (projection instanceof FieldProjection) { return new FieldProjector((FieldProjection) projection, ctxPath, ctx); } else if (projection instanceof ProjectionList) { return new ListProjector((ProjectionList) projection, ctxPath, ctx); } else if (projection instanceof ArrayRangeProjection) { return new ArrayRangeProjector((ArrayRangeProjection) projection, ctxPath, ctx); } else { return new ArrayQueryProjector((ArrayQueryMatchProjection) projection, ctxPath, ctx); } }
@Override protected Projection.Inclusion projectArray(Path p, QueryEvaluationContext ctx) { LOGGER.debug("Evaluating array query projection for {}", p); Path contextRoot = ctx.getPath(); QueryEvaluationContext nestedContext = ctx.getNestedContext(contextRoot.isEmpty() ? p : p.suffix(-contextRoot.numSegments())); if (query.evaluate(nestedContext)) { LOGGER.debug("query evaluates to true"); return isIncluded() ? Projection.Inclusion.explicit_inclusion : Projection.Inclusion.explicit_exclusion; } return isIncluded() ? Projection.Inclusion.explicit_exclusion : Projection.Inclusion.explicit_inclusion; } }
/** * Builds a (potentially nested) projection based on the given projection, * and the location in the metadata field tree. */ public static Projector getInstance(Projection projection, Path ctxPath, FieldTreeNode ctx) { if (projection instanceof FieldProjection) { return new FieldProjector((FieldProjection) projection, ctxPath, ctx); } else if (projection instanceof ProjectionList) { return new ListProjector((ProjectionList) projection, ctxPath, ctx); } else if (projection instanceof ArrayRangeProjection) { return new ArrayRangeProjector((ArrayRangeProjection) projection, ctxPath, ctx); } else { return new ArrayQueryProjector((ArrayQueryMatchProjection) projection, ctxPath, ctx); } }