/** * Sets the relative path to the property in this relation. * * @param relPath the relative path to a property. * @throws IllegalArgumentException if <code>relPath</code> is absolute. */ public void setRelativePath(Path relPath) { if (relPath.isAbsolute()) { throw new IllegalArgumentException("relPath must be relative"); } Element[] elements = relPath.getElements(); for (Element element : elements) { addPathElement(element); } }
/** * Sets the relative path to the property in this relation. * * @param relPath the relative path to a property. * @throws IllegalArgumentException if <code>relPath</code> is absolute. */ public void setRelativePath(Path relPath) { if (relPath.isAbsolute()) { throw new IllegalArgumentException("relPath must be relative"); } Element[] elements = relPath.getElements(); for (Element element : elements) { addPathElement(element); } }
/** * Applies {@link #tmpRelPath} to <code>node</code> and reset the path to * <code>null</code>. * * @param node a relation query node. */ private void applyRelativePath(RelationQueryNode node) { Path relPath = getRelativePath(); if (relPath != null) { for (int i = 0; i < relPath.getLength(); i++) { node.addPathElement(relPath.getElements()[i]); } } }
/** * Applies {@link #tmpRelPath} to <code>node</code> and reset the path to * <code>null</code>. * * @param node a relation query node. */ private void applyRelativePath(RelationQueryNode node) { Path relPath = getRelativePath(); if (relPath != null) { for (int i = 0; i < relPath.getLength(); i++) { node.addPathElement(relPath.getElements()[i]); } } }
rel.addPathElement(PATH_FACTORY.createElement(FN_POSITION_FULL)); } else { exceptions.add(new InvalidQueryException("Unsupported expression with position(). Only = is supported.")); rel.addPathElement(PATH_FACTORY.createElement(NameConstants.JCR_PRIMARYTYPE)); } else { exceptions.add(new InvalidQueryException( Path.Element element = PATH_FACTORY.createElement(name); RelationQueryNode relNode = (RelationQueryNode) queryNode; relNode.addPathElement(element); } catch (NameException e) { exceptions.add(e);
rel.addPathElement(PATH_FACTORY.createElement(FN_POSITION_FULL)); } else { exceptions.add(new InvalidQueryException("Unsupported expression with position(). Only = is supported.")); rel.addPathElement(PATH_FACTORY.createElement(NameConstants.JCR_PRIMARYTYPE)); } else { exceptions.add(new InvalidQueryException( Path.Element element = PATH_FACTORY.createElement(name); RelationQueryNode relNode = (RelationQueryNode) queryNode; relNode.addPathElement(element); } catch (NameException e) { exceptions.add(e);
} else if (queryNode.getType() == QueryNode.TYPE_RELATION) { Path.Element element = PATH_FACTORY.createElement(name); ((RelationQueryNode) queryNode).addPathElement(element); } else if (queryNode.getType() == QueryNode.TYPE_PATH) { root.addSelectProperty(name); ((LocationStepQueryNode) queryNode).setNameTest(null); } else if (queryNode.getType() == QueryNode.TYPE_RELATION) { ((RelationQueryNode) queryNode).addPathElement( PATH_FACTORY.createElement(RelationQueryNode.STAR_NAME_TEST)); } else if (queryNode.getType() == QueryNode.TYPE_TEXTSEARCH) {
} else if (queryNode.getType() == QueryNode.TYPE_RELATION) { Path.Element element = PATH_FACTORY.createElement(name); ((RelationQueryNode) queryNode).addPathElement(element); } else if (queryNode.getType() == QueryNode.TYPE_PATH) { root.addSelectProperty(name); ((LocationStepQueryNode) queryNode).setNameTest(null); } else if (queryNode.getType() == QueryNode.TYPE_RELATION) { ((RelationQueryNode) queryNode).addPathElement( PATH_FACTORY.createElement(RelationQueryNode.STAR_NAME_TEST)); } else if (queryNode.getType() == QueryNode.TYPE_TEXTSEARCH) {
((LocationStepQueryNode) queryNode).setNameTest(PATH_FACTORY.getParentElement().getName()); } else { ((RelationQueryNode) queryNode).addPathElement(PATH_FACTORY.getParentElement());
((LocationStepQueryNode) queryNode).setNameTest(PATH_FACTORY.getParentElement().getName()); } else { ((RelationQueryNode) queryNode).addPathElement(PATH_FACTORY.getParentElement());