/** * Create a new <code>desscendant-or-self</code> axis iterator. * * @param contextNode the node to start from * @param navigator the object model specific navigator */ public DescendantOrSelfAxisIterator(Object contextNode, Navigator navigator) { super(navigator, new SingleObjectIterator(contextNode)); }
public Iterator getDescendantAxisIterator(Object contextNode) throws UnsupportedAxisException { return new DescendantAxisIterator( contextNode, this ); }
public Iterator getPrecedingAxisIterator(Object contextNode) throws UnsupportedAxisException { return new PrecedingAxisIterator( contextNode, this ); // throw new UnsupportedAxisException("preceding"); }
private boolean goForward() { while ( ! siblings.hasNext() ) { if ( !goUp() ) { return false; } } Object nextSibling = siblings.next(); this.currentSibling = new DescendantOrSelfAxisIterator(nextSibling, navigator); return true; }
public Iterator getDescendantOrSelfAxisIterator(Object contextNode) throws UnsupportedAxisException { return new DescendantOrSelfAxisIterator( contextNode, this ); }
public Iterator getAncestorOrSelfAxisIterator(Object contextNode) throws UnsupportedAxisException { return new AncestorOrSelfAxisIterator( contextNode, this ); }
static public List convertToList(Object obj) { if ( obj instanceof List ) { return (List) obj; } return new SingletonList(obj); } }
public Iterator getFollowingSiblingAxisIterator(Object contextNode) throws UnsupportedAxisException { return new FollowingSiblingAxisIterator( contextNode, this ); }
public Iterator getFollowingAxisIterator(Object contextNode) throws UnsupportedAxisException { return new FollowingAxisIterator( contextNode, this ); // throw new UnsupportedAxisException("following"); }
public Iterator getAncestorAxisIterator(Object contextNode) throws UnsupportedAxisException { return new AncestorAxisIterator( contextNode, this ); }
public Iterator getPrecedingSiblingAxisIterator(Object contextNode) throws UnsupportedAxisException { return new PrecedingSiblingAxisIterator( contextNode, this ); }
public Iterator getSelfAxisIterator(Object contextNode) throws UnsupportedAxisException { return new SelfAxisIterator( contextNode ); }
/** * Create a new <code>following-sibling</code> axis iterator. * * @param contextNode the node to start from * @param navigator the object model specific navigator */ public FollowingSiblingAxisIterator(Object contextNode, Navigator navigator) throws UnsupportedAxisException { this.contextNode = contextNode; this.navigator = navigator; init(); }
/** * Create a new ancestor axis iterator. * * @param contextNode the node to start from * @param navigator the object model specific navigator */ public AncestorAxisIterator(Object contextNode, Navigator navigator) { super( contextNode, navigator ); next(); }
public boolean hasNext() { Iterator curIter = currentIterator(); if ( curIter == null ) { return false; } return curIter.hasNext(); }
protected Iterator internalCreateIterator(Object contextNode) { if ( this.created.contains( contextNode ) ) { return null; } this.created.add( contextNode ); return createIterator( contextNode ); }
/** * Create a new <code>preceding-sibling</code> axis iterator. * * @param contextNode the node to start from * @param navigator the object model specific navigator */ public PrecedingSiblingAxisIterator(Object contextNode, Navigator navigator) throws UnsupportedAxisException { this.contextNode = contextNode; this.navigator = navigator; init(); if ( siblingIter.hasNext() ) { this.nextObj = siblingIter.next(); } }
static public Iterator convertToIterator(Object obj) { if ( obj instanceof Iterator ) { return (Iterator) obj; } if ( obj instanceof List ) { return ((List)obj).iterator(); } return new SingleObjectIterator( obj ); }
public Iterator getParentAxisIterator(Object contextNode) { if ( contextNode instanceof Element ) { return new SingleObjectIterator( ((Element)contextNode).getParent() ); } return JaxenConstants.EMPTY_ITERATOR; }
public Iterator getParentAxisIterator(Object contextNode) { if ( contextNode instanceof Document ) { return JaxenConstants.EMPTY_ITERATOR; } Node node = (Node) contextNode; Object parent = node.getParent(); if ( parent == null ) { parent = node.getDocument(); } return new SingleObjectIterator( parent ); }