/** * Determine if the field is explicitly included/excluded, implicitly * included, or the projection does not decide on the field. */ public Inclusion getFieldInclusion(Path field, Path ctx) { Path mfield = toMask(field); ctx = toMask(ctx); if (this instanceof FieldProjection) { return getFieldInclusion(mfield, (FieldProjection) this, ctx); } else if (this instanceof ArrayProjection) { return getFieldInclusion(mfield, (ArrayProjection) this, ctx); } else if (this instanceof ProjectionList) { return getFieldInclusion(mfield, (ProjectionList) this, ctx); } return Inclusion.undecided; }
/** * Determine if the field is explicitly included/excluded, implicitly * included, or the projection does not decide on the field. */ public Inclusion getFieldInclusion(Path field, Path ctx) { Path mfield = toMask(field); ctx = toMask(ctx); if (this instanceof FieldProjection) { return getFieldInclusion(mfield, (FieldProjection) this, ctx); } else if (this instanceof ArrayProjection) { return getFieldInclusion(mfield, (ArrayProjection) this, ctx); } else if (this instanceof ProjectionList) { return getFieldInclusion(mfield, (ProjectionList) this, ctx); } return Inclusion.undecided; }
private Inclusion getFieldInclusion(Path field, FieldProjection p, Path context) { Path projectionField = new Path(context, toMask(p.getField())); LOGGER.debug("Checking if field projection on {} projects {}", projectionField, field); Inclusion inc = isFieldIncluded(field, projectionField, p.isInclude(), p.isRecursive()); LOGGER.debug("Field projection on {} projects {}: {}", projectionField, field, inc); return inc; }
private Inclusion getFieldInclusion(Path field, FieldProjection p, Path context) { Path projectionField = new Path(context, toMask(p.getField())); LOGGER.debug("Checking if field projection on {} projects {}", projectionField, field); Inclusion inc = isFieldIncluded(field, projectionField, p.isInclude(), p.isRecursive()); LOGGER.debug("Field projection on {} projects {}: {}", projectionField, field, inc); return inc; }
private Inclusion getFieldInclusion(Path field, ArrayProjection p, Path context) { Path absField = new Path(context, toMask(p.getField())); LOGGER.debug("Checking if array projection on {} projects {}", absField, field); Inclusion inc = isFieldIncluded(field, absField, p.isInclude(), false); Inclusion inc2 = p.getProject().getFieldInclusion(field, new Path(absField, Path.ANYPATH)); Inclusion ret; if (inc == Inclusion.explicit_inclusion || inc2 == Inclusion.explicit_inclusion) { ret = Inclusion.explicit_inclusion; } else if (inc == Inclusion.implicit_inclusion || inc2 == Inclusion.implicit_inclusion) { ret = Inclusion.implicit_inclusion; } else if (inc == Inclusion.explicit_exclusion || inc2 == Inclusion.explicit_exclusion) { ret = Inclusion.explicit_exclusion; } else if (inc == Inclusion.implicit_exclusion || inc2 == Inclusion.implicit_exclusion) { ret = Inclusion.implicit_exclusion; } else { ret = Inclusion.undecided; } LOGGER.debug("array projection on {} projects {}: {}", absField, field, ret); return ret; }
Path mfield = toMask(field); ctx = toMask(ctx); if (this instanceof FieldProjection) { switch (getFieldInclusion(mfield, (FieldProjection) this, ctx)) { if (getFieldInclusion(mfield, (ArrayProjection) this, ctx) == Inclusion.undecided) { LOGGER.debug("whether to include {} is Undecided, checking projection query", mfield); Path absField = new Path(ctx, toMask(((ArrayQueryMatchProjection) this).getField())); Path nestedCtx = new Path(absField, Path.ANYPATH); boolean ret = ((ArrayQueryMatchProjection) this).getMatch().isRequired(field, nestedCtx);
private Inclusion getFieldInclusion(Path field, ArrayProjection p, Path context) { Path absField = new Path(context, toMask(p.getField())); LOGGER.debug("Checking if array projection on {} projects {}", absField, field); Inclusion inc = isFieldIncluded(field, absField, p.isInclude(), false); Inclusion inc2 = p.getProject().getFieldInclusion(field, new Path(absField, Path.ANYPATH)); Inclusion ret; if (inc == Inclusion.explicit_inclusion || inc2 == Inclusion.explicit_inclusion) { ret = Inclusion.explicit_inclusion; } else if (inc == Inclusion.implicit_inclusion || inc2 == Inclusion.implicit_inclusion) { ret = Inclusion.implicit_inclusion; } else if (inc == Inclusion.explicit_exclusion || inc2 == Inclusion.explicit_exclusion) { ret = Inclusion.explicit_exclusion; } else if (inc == Inclusion.implicit_exclusion || inc2 == Inclusion.implicit_exclusion) { ret = Inclusion.implicit_exclusion; } else { ret = Inclusion.undecided; } LOGGER.debug("array projection on {} projects {}: {}", absField, field, ret); return ret; }
Path mfield = toMask(field); ctx = toMask(ctx); if (this instanceof FieldProjection) { switch (getFieldInclusion(mfield, (FieldProjection) this, ctx)) { if (getFieldInclusion(mfield, (ArrayProjection) this, ctx) == Inclusion.undecided) { LOGGER.debug("whether to include {} is Undecided, checking projection query", mfield); Path absField = new Path(ctx, toMask(((ArrayQueryMatchProjection) this).getField())); Path nestedCtx = new Path(absField, Path.ANYPATH); boolean ret = ((ArrayQueryMatchProjection) this).getMatch().isRequired(field, nestedCtx);