public Object visit(QueryRootNode node, Object data) throws RepositoryException { BooleanQuery root = new BooleanQuery(); Query wrapped = root; if (node.getLocationNode() != null) { wrapped = (Query) node.getLocationNode().accept(this, root); } return wrapped; }
public Object visit(QueryRootNode node, Object data) throws RepositoryException { BooleanQuery root = new BooleanQuery(); Query wrapped = root; if (node.getLocationNode() != null) { wrapped = (Query) node.getLocationNode().accept(this, root); } return wrapped; }
/** * Creates the primary path query node. * * @param node xpath node representing the root of the parsed tree. * @return the path query node */ private PathQueryNode createPathQueryNode(SimpleNode node) { root.setLocationNode(factory.createPathQueryNode(root)); node.childrenAccept(this, root.getLocationNode()); return root.getLocationNode(); }
/** * Creates the primary path query node. * * @param node xpath node representing the root of the parsed tree. * @return the path query node */ private PathQueryNode createPathQueryNode(SimpleNode node) { root.setLocationNode(factory.createPathQueryNode(root)); node.childrenAccept(this, root.getLocationNode()); return root.getLocationNode(); }
public Object visit(QueryRootNode node, Object data) throws RepositoryException { StringBuffer buffer = (StringBuffer) data; buffer.append("+ Root node"); buffer.append("\n"); // select properties Name[] select = node.getSelectProperties(); buffer.append("+ Select properties: "); if (select.length == 0) { buffer.append("*"); } else { String comma = ""; for (int i = 0; i < select.length; i++) { buffer.append(comma); buffer.append(select[i].toString()); comma = ", "; } } buffer.append("\n"); // path traverse(new QueryNode[]{node.getLocationNode()}, buffer); // order by OrderQueryNode order = node.getOrderNode(); if (order != null) { traverse(new QueryNode[]{order}, buffer); } return buffer; }
public Object visit(QueryRootNode node, Object data) throws RepositoryException { StringBuffer buffer = (StringBuffer) data; buffer.append("+ Root node"); buffer.append("\n"); // select properties Name[] select = node.getSelectProperties(); buffer.append("+ Select properties: "); if (select.length == 0) { buffer.append("*"); } else { String comma = ""; for (int i = 0; i < select.length; i++) { buffer.append(comma); buffer.append(select[i].toString()); comma = ", "; } } buffer.append("\n"); // path traverse(new QueryNode[]{node.getLocationNode()}, buffer); // order by OrderQueryNode order = node.getOrderNode(); if (order != null) { traverse(new QueryNode[]{order}, buffer); } return buffer; }
public Object visit(QueryRootNode node, Object data) throws RepositoryException { PathQueryNode pathNode = node.getLocationNode(); if (pathNode != null) { pathNode.accept(this, data); } OrderQueryNode orderNode = node.getOrderNode(); if (orderNode != null) { orderNode.accept(this, data); } return data; }
public Object visit(QueryRootNode node, Object data) throws RepositoryException { PathQueryNode pathNode = node.getLocationNode(); if (pathNode != null) { pathNode.accept(this, data); } OrderQueryNode orderNode = node.getOrderNode(); if (orderNode != null) { orderNode.accept(this, data); } return data; }
public Object visit(QueryRootNode node, Object data) throws RepositoryException { StringBuffer sb = (StringBuffer) data; node.getLocationNode().accept(this, data); Name[] selectProps = node.getSelectProperties(); if (selectProps.length > 0) { sb.append('/'); boolean union = selectProps.length > 1; if (union) { sb.append('('); } String pipe = ""; for (int i = 0; i < selectProps.length; i++) { try { sb.append(pipe); sb.append('@'); sb.append(resolver.getJCRName(encode(selectProps[i]))); pipe = "|"; } catch (NamespaceException e) { exceptions.add(e); } } if (union) { sb.append(')'); } } if (node.getOrderNode() != null) { node.getOrderNode().accept(this, data); } return data; }
public Object visit(QueryRootNode node, Object data) throws RepositoryException { StringBuffer sb = (StringBuffer) data; node.getLocationNode().accept(this, data); Name[] selectProps = node.getSelectProperties(); if (selectProps.length > 0) { sb.append('/'); boolean union = selectProps.length > 1; if (union) { sb.append('('); } String pipe = ""; for (int i = 0; i < selectProps.length; i++) { try { sb.append(pipe); sb.append('@'); sb.append(resolver.getJCRName(encode(selectProps[i]))); pipe = "|"; } catch (NamespaceException e) { exceptions.add(e); } } if (union) { sb.append(')'); } } if (node.getOrderNode() != null) { node.getOrderNode().accept(this, data); } return data; }
LocationStepQueryNode[] steps = node.getLocationNode().getPathSteps(); QueryNode[] predicates = steps[steps.length - 1].getPredicates(); sb.append(" WHERE "); node.getLocationNode().accept(this, sb);
LocationStepQueryNode[] steps = node.getLocationNode().getPathSteps(); QueryNode[] predicates = steps[steps.length - 1].getPredicates(); sb.append(" WHERE "); node.getLocationNode().accept(this, sb);
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() {
PathQueryNode pathNode = root.getLocationNode(); pathNode.setAbsolute(true); if (pathConstraints.size() == 0) {
PathQueryNode pathNode = root.getLocationNode(); pathNode.setAbsolute(true); if (pathConstraints.size() == 0) {