/** * Get a NodeTest that all the nodes matching this pattern must satisfy * * @return a NodeTest, as specific as possible, which all the matching nodes satisfy */ public ItemType getItemType() { return AnyNodeTest.getInstance(); }
public AttributeAxisIterator(XOMNodeWrapper start, NodeTest test) { // use lazy instead of eager materialization (performance) this.start = start; if (test == AnyNodeTest.getInstance()) test = null; nodeTest = test; position = 0; cursor = 0; }
AttributeAxisIterator(XOMNodeWrapper start, NodeTest test) { // use lazy instead of eager materialization (performance) this.start = start; if (test == AnyNodeTest.getInstance()) test = null; nodeTest = test; cursor = 0; }
AttributeAxisIterator(XOMNodeWrapper start, NodeTest test) { // use lazy instead of eager materialization (performance) this.start = start; if (test == AnyNodeTest.getInstance()) test = null; nodeTest = test; cursor = 0; }
public ItemType getItemType() { return AnyNodeTest.getInstance(); } };
public AncestorAxisIterator(XOMNodeWrapper start, boolean includeSelf, NodeTest test) { // use lazy instead of eager materialization (performance) this.start = start; if (test == AnyNodeTest.getInstance()) test = null; nodeTest = test; if (!includeSelf) { current = start; } this.includeSelf = includeSelf; position = 0; }
/** * Get a NodeTest that all the nodes matching this pattern must satisfy * * @return a NodeTest, as specific as possible, which all the matching nodes satisfy */ public ItemType getItemType() { return AnyNodeTest.getInstance(); }
/** * Get a NodeTest that all the nodes matching this pattern must satisfy * * @return a NodeTest, as specific as possible, which all the matching nodes satisfy */ public ItemType getItemType() { return AnyNodeTest.getInstance(); }
/** * Return an iteration over the nodes reached by the given axis from this node * * @param axisNumber the axis to be used * @return a SequenceIterator that scans the nodes reached by the axis in turn. */ public AxisIterator iterateAxis(byte axisNumber) { return iterateAxis(axisNumber, AnyNodeTest.getInstance()); }
/** * Indicate that all the descendants of the nodes in this nodeset are required */ public void addDescendants() { for (PathMapNode node : this) { node.createArc(AxisInfo.DESCENDANT, AnyNodeTest.getInstance()); } }
@Override public AxisIterator iterateAxis(byte axisNumber) { return iterateAxis(axisNumber, AnyNodeTest.getInstance()); }
/** * Get a NodeTest that all the nodes matching this pattern must satisfy */ public NodeTest getNodeTest() { if (nodeType==Type.NODE) { return AnyNodeTest.getInstance(); } else { return NodeKindTest.makeNodeKindTest(nodeType); } }
/** * Indicate that all the descendants of the nodes in this nodeset are required */ public void addDescendants() { for (PathMapNode node : this) { node.createArc(AxisInfo.DESCENDANT, AnyNodeTest.getInstance()); } }
@Override protected AxisIterator iterateAttributes(NodeTest nodeTest) { AxisIterator iter = new AttributeEnumeration(this); if (nodeTest != AnyNodeTest.getInstance()) { iter = new Navigator.AxisFilter(iter, nodeTest); } return iter; }
/** * Indicate that all the descendants of the nodes in this nodeset are required */ public void addDescendants() { for (Iterator it=iterator(); it.hasNext();) { PathMapNode node = (PathMapNode)it.next(); AxisExpression down = new AxisExpression(Axis.DESCENDANT, AnyNodeTest.getInstance()); node.createArc(down); } }
@Override protected AxisIterator iterateAttributes(NodeTest nodeTest) { AxisIterator iter = new AttributeEnumeration(this); if (nodeTest != AnyNodeTest.getInstance()) { iter = new Navigator.AxisFilter(iter, nodeTest); } return iter; }
/** * Get a NodeTest to use as a filter for nodes, given a pattern. */ private static NodeTest getNodeTestForPattern(Pattern pattern) { ItemType type = pattern.getItemType(); if (type instanceof NodeTest) { return (NodeTest) type; } else if (pattern.getUType().overlaps(UType.ANY_NODE)) { return AnyNodeTest.getInstance(); } else { return ErrorType.getInstance(); } }
@Override protected AxisIterator iterateSiblings(NodeTest nodeTest, boolean forwards) { boolean elementOnly = nodeTest.getUType() == UType.ELEMENT; AxisIterator iter = new Navigator.EmptyTextFilter( new ChildEnumeration(this, false, forwards, elementOnly)); if (nodeTest != AnyNodeTest.getInstance()) { iter = new Navigator.AxisFilter(iter, nodeTest); } return iter; }
private void addReturnedArcs(XMLColumn xmlColumn, PathMapNode subNode) { if (xmlColumn.getSymbol().getType() == DataTypeManager.DefaultDataClasses.XML) { subNode.createArc(AxisInfo.DESCENDANT_OR_SELF, AnyNodeTest.getInstance()); } else { //this may not always be needed, but it doesn't harm anything subNode.createArc(AxisInfo.CHILD, NodeKindTest.TEXT); subNode.setAtomized(); } }
@Override protected AxisIterator iterateChildren(NodeTest nodeTest) { boolean elementOnly = nodeTest.getUType() == UType.ELEMENT; AxisIterator iter = new Navigator.EmptyTextFilter( new ChildEnumeration(this, true, true, elementOnly)); if (nodeTest != AnyNodeTest.getInstance()) { iter = new Navigator.AxisFilter(iter, nodeTest); } return iter; }