Package org.apache.axis2.om

Examples of org.apache.axis2.om.OMNode


            }
        }
        Iterator it = omEle.getChildren();
        if (it != null) {
            while (it.hasNext()) {
                OMNode ele = (OMNode) it.next();
                TestCase.assertNotNull("once the has next is not null, the " +
                        "element should not be null", ele);
                if (ele instanceof OMElement) {
                    walkThrough((OMElement) ele);
                }
View Full Code Here


            NodeList list = ele.getChildNodes();
            for (int i = 0; i < list.getLength(); i++) {
                Node node = list.item(i);
                if (node.getNodeType() == Node.ELEMENT_NODE) {
                    TestCase.assertTrue(it.hasNext());
                    OMNode tempOmNode = (OMNode) it.next();
                    while (tempOmNode.getType() != OMNode.ELEMENT_NODE) {
                        TestCase.assertTrue(it.hasNext());
                        tempOmNode = (OMNode) it.next();
                    }
                    compare((Element) node, (OMElement) tempOmNode);
                }
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

        if (cache) {
            element.build();
        }

        serializeStartpart(element, omOutput);
        OMNode firstChild = element.getFirstOMChild();
        if (firstChild != null) {
            if (cache) {
                ((OMNodeEx)firstChild).serialize(omOutput);
            } else {
                ((OMNodeEx)firstChild).serializeAndConsume(omOutput);
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 static OMElement getChildWithName(OMElement parent,
                                             String childName) {
        Iterator childrenIter = parent.getChildren();
        while (childrenIter.hasNext()) {
            OMNode node = (OMNode) childrenIter.next();
            if (node.getType() == OMNode.ELEMENT_NODE &&
                    childName.equals(((OMElement) node).getLocalName())) {
                return (OMElement) node;
            }
        }
        return null;
View Full Code Here

        OMElement element = getFirstElement();
        if (element != null) {
            if (SOAPConstants.BODY_LOCAL_NAME.equals(element.getLocalName())) {
                return (SOAPBody) element;
            } else {      // if not second element SHOULD be the body
                OMNode node = element.getNextOMSibling();
                while (node != null && node.getType() != OMNode.ELEMENT_NODE) {
                    node = node.getNextOMSibling();
                }
                element = (OMElement) node;

                if (node != null &&
                        SOAPConstants.BODY_LOCAL_NAME.equals(element.getLocalName())) {
View Full Code Here

     *
     * @return Returns OMNode.
     * @throws OMException
     */
    protected OMNode createOMText(int textType) throws OMException {
        OMNode node = null;
        if (lastNode == null) {
            return null;
        } else if (!lastNode.isComplete()) {
            node = omfactory.createText((OMElement) lastNode, parser.getText(), textType);
        } else if (!(lastNode.getParent() instanceof OMDocument)) {
View Full Code Here

        if (lastNode.isComplete()) {
            OMElement parent = (OMElement) lastNode.getParent();
            ((OMNodeEx) parent).setComplete(true);
            lastNode = parent;
        } else {
            OMNode e = lastNode;
            ((OMNodeEx) e).setComplete(true);
        }
        elementLevel--;
    }
View Full Code Here

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

TOP

Related Classes of org.apache.axis2.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.