public Object visit(PathQueryNode node, Object data) throws RepositoryException { StringBuffer sb = (StringBuffer) data; if (node.isAbsolute()) { sb.append("/"); } LocationStepQueryNode[] steps = node.getPathSteps(); String slash = ""; for (int i = 0; i < steps.length; i++) { sb.append(slash); steps[i].accept(this, sb); slash = "/"; } return sb; }
public Object visit(PathQueryNode node, Object data) throws RepositoryException { StringBuffer sb = (StringBuffer) data; if (node.isAbsolute()) { sb.append("/"); } LocationStepQueryNode[] steps = node.getPathSteps(); String slash = ""; for (int i = 0; i < steps.length; i++) { sb.append(slash); steps[i].accept(this, sb); slash = "/"; } return sb; }
/** * Returns <code>true</code> if <code>path</code> contains exactly one * step with a descendant-or-self axis and an explicit name test; returns * <code>false</code> otherwise. * * @param path the path node. * @return <code>true</code> if <code>path</code> contains exactly one * step with a descendant-or-self axis. */ private static boolean containsDescendantOrSelf(PathQueryNode path) { LocationStepQueryNode[] steps = path.getPathSteps(); int count = 0; for (int i = 0; i < steps.length; i++) { if (steps[i].getNameTest() != null && steps[i].getIncludeDescendants()) { count++; } } return count == 1; }
/** * Returns <code>true</code> if <code>path</code> contains exactly one * step with a descendant-or-self axis and an explicit name test; returns * <code>false</code> otherwise. * * @param path the path node. * @return <code>true</code> if <code>path</code> contains exactly one * step with a descendant-or-self axis. */ private static boolean containsDescendantOrSelf(PathQueryNode path) { LocationStepQueryNode[] steps = path.getPathSteps(); int count = 0; for (int i = 0; i < steps.length; i++) { if (steps[i].getNameTest() != null && steps[i].getIncludeDescendants()) { count++; } } return count == 1; }
/** * Returns <code>true</code> if <code>path</code> contains exactly one * location step which matches all node names. That is, matches any children * of a given node. That location step must be the last one in the sequence * of location steps. * * @param path the path node. * @return <code>true</code> if the last step matches any node name. */ private static boolean containsAllChildrenMatch(PathQueryNode path) { LocationStepQueryNode[] steps = path.getPathSteps(); int count = 0; for (int i = 0; i < steps.length; i++) { if (steps[i].getNameTest() == null && !steps[i].getIncludeDescendants()) { if (i == steps.length - 1 && count == 0) { return true; } count++; } } return false; } }
/** * Returns <code>true</code> if <code>path</code> contains exactly one * location step which matches all node names. That is, matches any children * of a given node. That location step must be the last one in the sequence * of location steps. * * @param path the path node. * @return <code>true</code> if the last step matches any node name. */ private static boolean containsAllChildrenMatch(PathQueryNode path) { LocationStepQueryNode[] steps = path.getPathSteps(); int count = 0; for (int i = 0; i < steps.length; i++) { if (steps[i].getNameTest() == null && !steps[i].getIncludeDescendants()) { if (i == steps.length - 1 && count == 0) { return true; } count++; } } return false; } }
sb.append(resolver.getJCRName(NameConstants.JCR_PATH)); sb.append(" LIKE '"); LocationStepQueryNode[] steps = node.getPathSteps(); for (int i = 0; i < steps.length; i++) { if (steps[i].getNameTest() == null sb.append(" LIKE '"); StringBuffer path = new StringBuffer(); LocationStepQueryNode[] steps = node.getPathSteps(); for (int i = 0; i < steps.length; i++) { if (steps[i].getNameTest() == null LocationStepQueryNode[] steps = node.getPathSteps(); for (int i = 0; i < steps.length; i++) { if (steps[i].getNameTest() == null
sb.append(resolver.getJCRName(NameConstants.JCR_PATH)); sb.append(" LIKE '"); LocationStepQueryNode[] steps = node.getPathSteps(); for (int i = 0; i < steps.length; i++) { if (steps[i].getNameTest() == null sb.append(" LIKE '"); StringBuffer path = new StringBuffer(); LocationStepQueryNode[] steps = node.getPathSteps(); for (int i = 0; i < steps.length; i++) { if (steps[i].getNameTest() == null LocationStepQueryNode[] steps = node.getPathSteps(); for (int i = 0; i < steps.length; i++) { if (steps[i].getNameTest() == null
LocationStepQueryNode[] steps = node.getLocationNode().getPathSteps(); QueryNode[] predicates = steps[steps.length - 1].getPredicates();
LocationStepQueryNode[] pathSteps = getPathSteps(); if (pathSteps == null || pathSteps.length == 0) { return true;
if (relPath == null) { propPath.append("."); } else if (relPath.getNumOperands() > 0 && XPathQueryBuilder.FN_POSITION_FULL.equals(relPath.getPathSteps()[0].getNameTest())) { propPath.append(resolver.getJCRName(XPathQueryBuilder.FN_POSITION_FULL)); } else { LocationStepQueryNode[] steps = relPath.getPathSteps(); String slash = ""; for (int i = 0; i < steps.length; i++) {
LocationStepQueryNode[] pathSteps = getPathSteps(); if (pathSteps == null || pathSteps.length == 0) { return true;
LocationStepQueryNode[] steps = pathNode.getPathSteps(); steps[steps.length - 1].addPredicate(constraintNode.getOperands()[0]); } else if (constraintNode.getNumOperands() > 1) { LocationStepQueryNode[] steps = pathNode.getPathSteps(); steps[steps.length - 1].addPredicate(constraintNode); LocationStepQueryNode[] steps = pathNode.getPathSteps(); NodeTypeQueryNode nodeType = factory.createNodeTypeQueryNode(steps[steps.length - 1], nodeTypeName);
LocationStepQueryNode[] steps = pathNode.getPathSteps(); steps[steps.length - 1].addPredicate(constraintNode.getOperands()[0]); } else if (constraintNode.getNumOperands() > 1) { LocationStepQueryNode[] steps = pathNode.getPathSteps(); steps[steps.length - 1].addPredicate(constraintNode); LocationStepQueryNode[] steps = pathNode.getPathSteps(); NodeTypeQueryNode nodeType = factory.createNodeTypeQueryNode(steps[steps.length - 1], nodeTypeName);
public Object visit(PathQueryNode node, Object data) throws RepositoryException { Query context = null; LocationStepQueryNode[] steps = node.getPathSteps(); if (steps.length > 0) { if (node.isAbsolute() && !steps[0].getIncludeDescendants()) {
public Object visit(PathQueryNode node, Object data) throws RepositoryException { Query context = null; LocationStepQueryNode[] steps = node.getPathSteps(); if (steps.length > 0) { if (node.isAbsolute() && !steps[0].getIncludeDescendants()) {
LocationStepQueryNode[] steps = root.getLocationNode().getPathSteps(); final Name[] ntName = new Name[1]; steps[steps.length - 1].acceptOperands(new DefaultQueryNodeVisitor() {
LocationStepQueryNode[] steps = root.getLocationNode().getPathSteps(); final Name[] ntName = new Name[1]; steps[steps.length - 1].acceptOperands(new DefaultQueryNodeVisitor() {
if (pathNode.getPathSteps()[0] != node) { Query subQuery = new DescendantSelfAxisQuery(context, andQuery, false); andQuery = new BooleanQuery(); if (pathNode.getPathSteps()[0] != node) { if (node.getIndex() == LocationStepQueryNode.NONE) { context = new DescendantSelfAxisQuery(context, false);
if (pathNode.getPathSteps()[0] != node) { Query subQuery = new DescendantSelfAxisQuery(context, andQuery, false); andQuery = new BooleanQuery(); if (pathNode.getPathSteps()[0] != node) { if (node.getIndex() == LocationStepQueryNode.NONE) { context = new DescendantSelfAxisQuery(context, false);