Package org.jaxen.util

Examples of org.jaxen.util.SingleObjectIterator


            Element node = (Element) contextNode;
            Namespace namespace = (namespaceURI == null ? Namespace.NO_NAMESPACE :
                                    Namespace.getNamespace(namespacePrefix, namespaceURI));
            Attribute attr = node.getAttribute(localName, namespace);
            if (attr != null) {
                return new SingleObjectIterator(attr);
            }
        }
        return JaxenConstants.EMPTY_ITERATOR;
    }
View Full Code Here


        if (o instanceof Node) {
            parent = ((Node)o).getParent();
        } else if (isNamespace(o)) {
            parent = ((XPathNamespace)o).getElement();
        }
        return (parent != null ? new SingleObjectIterator(parent) : null);
    }
View Full Code Here

        if ( obj instanceof List )
        {
            return ((List)obj).iterator();
        }

        return new SingleObjectIterator( obj );
    }
View Full Code Here

    public Iterator getParentAxisIterator(Object contextNode)
    {
        if ( contextNode instanceof Document )
        {
            return new SingleObjectIterator( contextNode );
        }

        Node node = (Node) contextNode;

        Object parent = node.getParent();

        if ( parent == null )
        {
            parent = node.getDocument();
        }
       
        return new SingleObjectIterator( parent );
    }
View Full Code Here

            parent = ((Text)contextNode).getParent();
        }
       
        if ( parent != null )
        {
            return new SingleObjectIterator( parent );
        }

        return null;
    }
View Full Code Here

    public Iterator getParentAxisIterator(Object contextNode) throws UnsupportedAxisException
    {
        ((JaxenNode)contextNode).toBookmark(_xc);
        if (_xc.toParent())
            return new SingleObjectIterator(getBookmarkInThisPlace(_xc));
        else
            return null;
    }
View Full Code Here

        if ( obj instanceof List )
        {
            return ((List)obj).iterator();
        }

        return new SingleObjectIterator( obj );
    }
View Full Code Here

     * @throws UnsupportedAxisException if the semantics of the parent axis are
     *                                  not supported by this object model
     */
    public Iterator getParentAxisIterator(Object contextNode) throws UnsupportedAxisException {
        if (contextNode instanceof OMNode) {
            return new SingleObjectIterator(((OMNode) contextNode).getParent());
        } else if (contextNode instanceof OMNamespaceEx) {
            return new SingleObjectIterator(
                    ((OMNamespaceEx) contextNode).getParent());
        } else if (contextNode instanceof OMAttributeEx) {
            return new SingleObjectIterator(
                    ((OMAttributeEx) contextNode).getParent());
        }
        return JaxenConstants.EMPTY_ITERATOR;
    }
View Full Code Here

     * @throws UnsupportedAxisException if the semantics of the parent axis are not supported by
     *                                  this object model
     */
    public Iterator getParentAxisIterator(Object contextNode) throws UnsupportedAxisException {
        if (contextNode instanceof OMNode) {
            return new SingleObjectIterator(((OMNode) contextNode).getParent());
        } else if (contextNode instanceof OMNamespaceEx) {
            return new SingleObjectIterator(
                    ((OMNamespaceEx) contextNode).getParent());
        } else if (contextNode instanceof OMAttributeEx) {
            return new SingleObjectIterator(
                    ((OMAttributeEx) contextNode).getParent());
        }
        return JaxenConstants.EMPTY_ITERATOR;
    }
View Full Code Here

TOP

Related Classes of org.jaxen.util.SingleObjectIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.