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 Path absolutePath(Path p) { if (contextPath.numSegments() == 0) { return p.immutableCopy(); } else { return new Path(contextPath, p); } }
/** * Returns a path with all possible $parent and $this references removed. If * there are prefixing $parents, they will remain. */ public Path normalize() { boolean parentThisPresent = false; Iterator<String> dataItr = data.iterator(); while (dataItr.hasNext()) { String s = dataItr.next(); if (PARENT.equals(s) || THIS.equals(s)) { parentThisPresent = true; break; } } if (parentThisPresent) { MutablePath p = new MutablePath(); dataItr = data.iterator(); while (dataItr.hasNext()) { String s = dataItr.next(); if (PARENT.equals(s) && p.numSegments() > 0) { p.pop(); } else if (!THIS.equals(s)) { p.push(s); } } return p.immutableCopy(); } else { return this; } }
/** * Returns a path with all possible $parent and $this references removed. If * there are prefixing $parents, they will remain. */ public Path normalize() { boolean parentThisPresent = false; Iterator<String> dataItr = data.iterator(); while (dataItr.hasNext()) { String s = dataItr.next(); if (PARENT.equals(s) || THIS.equals(s)) { parentThisPresent = true; break; } } if (parentThisPresent) { MutablePath p = new MutablePath(); dataItr = data.iterator(); while (dataItr.hasNext()) { String s = dataItr.next(); if (PARENT.equals(s) && p.numSegments() > 0) { p.pop(); } else if (!THIS.equals(s)) { p.push(s); } } return p.immutableCopy(); } else { return this; } }
if (newFieldName.numSegments() > 1) { parent = (DBObject) DocTranslator.getDBObject(doc, newFieldName.prefix(-1)); } else {