@Override protected Boolean projectArray(Path p, QueryEvaluationContext ctx) { // Is this array element in range? int index = p.getIndex(p.numSegments() - 1); if (index >= from && index <= to) { // This array element is selected. setLastMatch(true); return isIncluded() ? Boolean.TRUE : Boolean.FALSE; } else { return Boolean.FALSE; } } }
@Override protected Projection.Inclusion projectArray(Path p, QueryEvaluationContext ctx) { // Is this array element in range? int index = p.getIndex(p.numSegments() - 1); if (to == null) { if (index >= from) { // This array element is selected. return isIncluded() ? Projection.Inclusion.explicit_inclusion : Projection.Inclusion.explicit_exclusion; } else { return Projection.Inclusion.explicit_exclusion; } } else if (to < 0) { return Projection.Inclusion.explicit_exclusion; } else if (from <= to && index >= from && index <= to) { // This array element is selected. return isIncluded() ? Projection.Inclusion.explicit_inclusion : Projection.Inclusion.explicit_exclusion; } else { return Projection.Inclusion.explicit_exclusion; } } }
@Override protected Projection.Inclusion projectArray(Path p, QueryEvaluationContext ctx) { // Is this array element in range? int index = p.getIndex(p.numSegments() - 1); if (to == null) { if (index >= from) { // This array element is selected. return isIncluded() ? Projection.Inclusion.explicit_inclusion : Projection.Inclusion.explicit_exclusion; } else { return Projection.Inclusion.explicit_exclusion; } } else if (to < 0) { return Projection.Inclusion.explicit_exclusion; } else if (from <= to && index >= from && index <= to) { // This array element is selected. return isIncluded() ? Projection.Inclusion.explicit_inclusion : Projection.Inclusion.explicit_exclusion; } else { return Projection.Inclusion.explicit_exclusion; } } }
if (parent instanceof ArrayNode) { ArrayNode arr = (ArrayNode) parent; int index = p.getIndex(level);
if (parent instanceof ArrayNode) { ArrayNode arr = (ArrayNode) parent; int index = p.getIndex(level);
if (parent instanceof ArrayNode) { ArrayNode arr = (ArrayNode) parent; int index = p.getIndex(level);
insertionIndex = expr.getField().getIndex(expr.getField().numSegments() - 1); } else { throw new EvaluationError(CrudConstants.ERR_REQUIRED_INSERTION_INDEX + expr.getField());
insertionIndex = expr.getField().getIndex(expr.getField().numSegments() - 1); } else { throw new EvaluationError(CrudConstants.ERR_REQUIRED_INSERTION_INDEX + expr.getField());
insertionIndex = expr.getField().getIndex(expr.getField().numSegments() - 1); } else { throw new EvaluationError(CrudConstants.ERR_REQUIRED_INSERTION_INDEX + expr.getField());