@Override public final boolean equals(Object that) { if (this == that) { return true; } else if (that instanceof Path) { Path path = (Path) that; return path.denotesCurrent() && super.equals(that); } else { return false; } }
@Override public final boolean equals(Object that) { if (this == that) { return true; } else if (that instanceof Path) { Path path = (Path) that; return path.denotesCurrent() && super.equals(that); } else { return false; } }
public boolean isNormalized() { return parent == null || (parent.isNormalized() && !parent.denotesCurrent()); }
public boolean isNormalized() { return parent == null || (parent.isNormalized() && !parent.denotesCurrent()); }
public Path getNormalizedPath() throws RepositoryException { if (isNormalized()) { return this; } else { // parent is guaranteed to be !null Path normalized = parent.getNormalizedPath(); if (normalized.denotesCurrent()) { normalized = null; // special case: ./a } return new NamePath(normalized, name, index); } }
public Path getNormalizedPath() throws RepositoryException { if (isNormalized()) { return this; } else { // parent is guaranteed to be !null Path normalized = parent.getNormalizedPath(); if (normalized.denotesCurrent()) { normalized = null; // special case: ./a } return new NamePath(normalized, name, index); } }
/** * @param relativePath * @return normalized absolute path calculated from the given relative * path and the path of this node. * @throws RepositoryException */ private Path getPath(Path relativePath) throws RepositoryException { // shortcut if (relativePath.getLength() == 1 && relativePath.denotesCurrent()) { return getQPath(); } return session.getPathFactory().create(getQPath(), relativePath, true); }
/** * @param relativePath * @return normalized absolute path calculated from the given relative * path and the path of this node. * @throws RepositoryException */ private Path getPath(Path relativePath) throws RepositoryException { // shortcut if (relativePath.getLength() == 1 && relativePath.denotesCurrent()) { return getQPath(); } return session.getPathFactory().create(getQPath(), relativePath, true); }
public Path getNormalizedPath() throws RepositoryException { if (isNormalized()) { return this; } else { // parent is guaranteed to be !null Path normalized = parent.getNormalizedPath(); if (normalized.denotesParent()) { return new ParentPath(normalized); // special case: ../.. } else if (normalized.denotesCurrent()) { return new ParentPath(null); // special case: ./.. } else { return normalized.getAncestor(1); } } }
public Path getNormalizedPath() throws RepositoryException { if (isNormalized()) { return this; } else { // parent is guaranteed to be !null Path normalized = parent.getNormalizedPath(); if (normalized.denotesParent()) { return new ParentPath(normalized); // special case: ../.. } else if (normalized.denotesCurrent()) { return new ParentPath(null); // special case: ./.. } else { return normalized.getAncestor(1); } } }
public final Path resolve(Path relative) { if (relative.isAbsolute()) { return relative; } else if (relative.getLength() > 1) { Path first = relative.getFirstElements(); Path last = relative.getLastElement(); return resolve(first).resolve(last); } else if (relative.denotesCurrent()) { return new CurrentPath(this); } else if (relative.denotesParent()) { return new ParentPath(this); } else if (relative.denotesName()) { return new NamePath(this, relative.getName(), relative.getIndex()); } else { throw new IllegalArgumentException( "Unknown path type: " + relative); } }
public final Path resolve(Path relative) { if (relative.isAbsolute()) { return relative; } else if (relative.getLength() > 1) { Path first = relative.getFirstElements(); Path last = relative.getLastElement(); return resolve(first).resolve(last); } else if (relative.denotesCurrent()) { return new CurrentPath(this); } else if (relative.denotesParent()) { return new ParentPath(this); } else if (relative.denotesName()) { return new NamePath(this, relative.getName(), relative.getIndex()); } else { throw new IllegalArgumentException( "Unknown path type: " + relative); } }
outerIdx = getIndex(outer, node.getSelector1QName()); Path selector2Path = node.getSelector2QPath(); if (selector2Path == null || (selector2Path.getLength() == 1 && selector2Path.denotesCurrent())) { c = new SameNodeJoin(src2, node.getSelector2QName(), reader); } else { outerIdx = getIndex(outer, node.getSelector2QName()); Path selector2Path = node.getSelector2QPath(); if (selector2Path == null || (selector2Path.getLength() == 1 && selector2Path.denotesCurrent())) { c = new SameNodeJoin(src1, node.getSelector1QName(), reader); } else {
outerIdx = getIndex(outer, node.getSelector1QName()); Path selector2Path = node.getSelector2QPath(); if (selector2Path == null || (selector2Path.getLength() == 1 && selector2Path.denotesCurrent())) { c = new SameNodeJoin(src2, node.getSelector2QName(), reader); } else { outerIdx = getIndex(outer, node.getSelector2QName()); Path selector2Path = node.getSelector2QPath(); if (selector2Path == null || (selector2Path.getLength() == 1 && selector2Path.denotesCurrent())) { c = new SameNodeJoin(src1, node.getSelector1QName(), reader); } else {
if (rp.denotesCurrent()) { targetEntry = getNodeEntry(); } else if (rp.denotesParent()) {
if (rp.denotesCurrent()) { targetEntry = getNodeEntry(); } else if (rp.denotesParent()) {