/** * Create a deep copy of this Path. * * @return the new path */ public Path copy() { return new Path(this); }
/** * Returns this+p */ public Path add(Path p) { return new Path(this, p); }
/** * Returns this+p */ public Path add(Path p) { return new Path(this, p); }
public ChildSlot(Path localContainerName, ResolvedReferenceField reference) { this.localContainerName = localContainerName; this.referenceFieldName = reference.getName(); this.reference = reference; this.slotFieldName = localContainerName.isEmpty() ? new Path(referenceFieldName) : new Path(localContainerName, new Path(referenceFieldName)); }
private Path applyContext(Path context, Path p) { if (context.isEmpty()) { return p; } else { return new Path(context, p); } }
private Path addPrefix(Path fieldName) { if (nestedFieldPrefix.isEmpty()) { return fieldName; } else { return new Path(nestedFieldPrefix, fieldName); } }
private Path applyContext(Path context, Path p) { if (context.isEmpty()) { return p; } else { return new Path(context, p); } }
private Path addPrefix(Path fieldName) { if (nestedFieldPrefix.isEmpty()) { return fieldName; } else { return new Path(nestedFieldPrefix, fieldName); } }
private static boolean isFieldQueried(Path field, Path qField, Path context) { LOGGER.debug("Checking if field {} is included in qfield={} with context={}", field, qField, context); Path absField = context.isEmpty() ? qField : new Path(context, qField); if (field.matchingPrefix(absField)) { LOGGER.debug("Field {} is queried", absField); return true; } else { LOGGER.debug("Field {} is not queried", absField); return false; } }
private static boolean isFieldQueried(Path field, Path qField, Path context) { LOGGER.debug("Checking if field {} is included in qfield={} with context={}", field, qField, context); Path absField = context.isEmpty() ? qField : new Path(context, qField); if (field.matchingPrefix(absField)) { LOGGER.debug("Field {} is queried", absField); return true; } else { LOGGER.debug("Field {} is not queried", absField); return false; } }
@Override protected T itrArrayMatchExpression(ArrayMatchExpression q, Path context) { QueryFieldInfo oldArray=enclosingArray; enclosingArray=findFieldInfo(q.getArray(),q); T ret=processArrayMatchExpression(q.getElemMatch(), new Path(new Path(context, q.getArray()), Path.ANYPATH)); enclosingArray=oldArray; return ret; } }
public Path absolutePath(Path p) { if (contextPath.numSegments() == 0) { return p.immutableCopy(); } else { return new Path(contextPath, p); } }
public Path absolutePath(Path p) { if (contextPath.numSegments() == 0) { return p.immutableCopy(); } else { return new Path(contextPath, p); } }
public FieldProjector(FieldProjection p, Path ctxPath, FieldTreeNode ctx) { super(ctxPath, ctx); field = new Path(ctxPath, p.getField()); include = p.isInclude(); recursive = p.isRecursive(); }
/** * Builds a composite metadata rooted at the given entity metadata. */ public static CompositeMetadata buildCompositeMetadata(EntityMetadata root, GetMetadata gmd) { CompositeMetadata cmd = buildCompositeMetadata(root, gmd, new Path(), null, new MutablePath()); // Re-process all resolved references, rewrite their queries in absolute form rewriteAssociationQueries(cmd); return cmd; }
public FieldProjector(FieldProjection p, Path ctxPath, FieldTreeNode ctx) { super(ctxPath, ctx); field = new Path(ctxPath, p.getField()); include = p.isInclude(); recursive = p.isRecursive(); }
private Path toRelative(Path field, Path context) { Path abs = context.isEmpty() ? field : new Path(context, field); if (relativeTo.matchingPrefix(abs)) { return abs.suffix(-relativeTo.numSegments()); } else { throw new IllegalArgumentException("Cannot write " + abs + " relative to " + relativeTo); } } }
@Override public Path immutableCopy() { Path p = new Path(); p.setData(new PathRep(getData())); return p; }
public FieldProjector(FieldProjection p, Path ctxPath, FieldTreeNode ctx) { super(ctxPath, ctx); field = new Path(ctxPath, p.getField()); include = p.isInclude(); recursive = p.isRecursive(); }