Package org.apache.ws.commons.om

Examples of org.apache.ws.commons.om.OMNode


     */
    public OMElement getFirstChildWithName(QName elementQName) throws OMException {
        OMChildrenQNameIterator omChildrenQNameIterator =
                new OMChildrenQNameIterator(getFirstOMChild(),
                        elementQName);
        OMNode omNode = null;
        if (omChildrenQNameIterator.hasNext()) {
            omNode = (OMNode) omChildrenQNameIterator.next();
        }

        return ((omNode != null) && (OMNode.ELEMENT_NODE == omNode.getType())) ?
                (OMElement) omNode : null;

    }
View Full Code Here


                backtracked = true;
            } else {
                next = null;
            }
        } else {
            OMNode nextSibling = ((OMNodeImpl) next).nextSibling;
            //OMNode parent = next.getParent();
            OMContainer parent = next.getParent();
            if (nextSibling != null) {
                next = nextSibling;
            } else if ((parent != null) && parent.isComplete()) {
View Full Code Here

    private void extractDetails(AsyncResult result) {
        Iterator iterator0, iterator1, iterator2, iterator3, iterator4;
        SOAPEnvelope resEnvilop;
        OMElement body;
        OMElement operation;
        OMNode node;
        OMElement elem;

        resEnvilop = result.getResponseEnvelope();
        body = resEnvilop.getBody();
        operation = body.getFirstElement();

        String opLocalName = operation.getLocalName();
        if (opLocalName.equals("Fault")) {
            log.info(
                    "A Fault message received, Check your Licence key");
            strURL =
                    strURL +
                    "A Fault message received, Check your Licence key. Else you have reached the " +
                    "daily limit of 1000 requests";
        } else {
            log.info("this is opera: " + operation.getLocalName());
            iterator0 = operation.getChildren();

            while (iterator0.hasNext()) {
                node = (OMNode) iterator0.next();
                if (node.getType() == OMNode.ELEMENT_NODE) {
                    elem = (OMElement) node;
                    String str = elem.getLocalName();
                    log.info(str);
                    if (str.equals("SearchResult")) {
                        log.info("Got Search Results");
                        iterator1 = elem.getChildren();
                        while (iterator1.hasNext()) {
                            node = (OMNode) iterator1.next();
                            if (node.getType() == OMNode.ELEMENT_NODE) {
                                elem = (OMElement) node;
                                String str1 = elem.getLocalName();
                                log.info(str1);
                                if (str1.equals("Alexa")) {
                                   log.info("Got Alexa");
                                    elem = elem.getFirstElement(); //elem -> websearch
                                    log.info("Should be WebSearch " +
                                            elem.getLocalName());
                                    iterator2 = elem.getChildren();
                                    while (iterator2.hasNext()) {
                                        node = (OMNode) iterator2.next();
                                        if (node.getType() ==
                                                OMNode.ELEMENT_NODE) {
                                            elem = (OMElement) node;
                                            String str3 = elem.getLocalName();
                                            if (str3.equals("Results")) {
                                                iterator3 = elem.getChildren();
                                                while (iterator3.hasNext()) {
                                                    node =
                                                            (OMNode) iterator3.next();
                                                    if (node.getType() ==
                                                            OMNode.ELEMENT_NODE) {
                                                        elem =
                                                                (OMElement) node;
                                                        String str4 = elem.getLocalName();
                                                        if (str4.equals(
                                                                "Result")) {
                                                            iterator4 =
                                                                    elem.getChildren();
                                                            while (iterator4.hasNext()) {
                                                                node =
                                                                        (OMNode) iterator4.next();
                                                                if (node.getType() ==
                                                                        OMNode.ELEMENT_NODE) {
                                                                    elem =
                                                                            (OMElement) node;
                                                                    String str5 = elem.getLocalName();
                                                                    if (str5.equals(
View Full Code Here

    public OMElement getFirstChildWithName(QName elementQName)
            throws OMException {
        Iterator children = new OMChildrenQNameIterator(getFirstOMChild(),
                elementQName);
        while (children.hasNext()) {
            OMNode node = (OMNode) children.next();

            // Return the first OMElement node that is found
            if (node instanceof OMElement) {
                return (OMElement) node;
            }
View Full Code Here

TOP

Related Classes of org.apache.ws.commons.om.OMNode

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.