Package org.jaxen.util

Examples of org.jaxen.util.SingleObjectIterator


     * @return A possibly-empty iterator (not null).
     */
    public Iterator getParentAxisIterator(Object aObject)
    {
        if (isAttribute(aObject)) {
            return new SingleObjectIterator(((Attribute) aObject).getParent());
        }
        else {
            DetailAST parent = ((DetailAST) aObject).getParent();
            if (parent != null) {
                return new SingleObjectIterator(parent);
            }
            else {
                return 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

     * @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

            if ( result.getClass().isArray() )
            {
                return JaxenConstants.EMPTY_ITERATOR;
            }
           
            return new SingleObjectIterator( new Element( (Element) contextNode, localName, result ) );
        }
        catch (IllegalAccessException e)
        {
            // swallow
        }
View Full Code Here

    public Iterator getParentAxisIterator(Object contextNode)
    {
        if ( contextNode instanceof Element )
        {
            return new SingleObjectIterator( ((Element)contextNode).getParent() );
        }

        return JaxenConstants.EMPTY_ITERATOR;
    }
View Full Code Here

            if (namespaceURI != null) {
                if (namespaceURI.equals(el.getNamespaceURI()) == false) {
                    return JaxenConstants.EMPTY_ITERATOR;
                }
            }
            return new SingleObjectIterator(el);
        }

        return JaxenConstants.EMPTY_ITERATOR;
    }
View Full Code Here

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

            Element node = (Element) contextNode;
            Attribute attr = node.attribute(QName.get(localName, namespacePrefix, namespaceURI));
            if (attr == null) {
                return JaxenConstants.EMPTY_ITERATOR;
            }
            return new SingleObjectIterator(attr);
        }
        return JaxenConstants.EMPTY_ITERATOR;
    }
View Full Code Here

            }
            else if(el.getNamespace() != Namespace.NO_NAMESPACE) {
                return JaxenConstants.EMPTY_ITERATOR;
            }
           
            return new SingleObjectIterator(el);
        }

        return JaxenConstants.EMPTY_ITERATOR;
    }
View Full Code Here

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

        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.