Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMContainer


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


                        AXIOMXPath xpath = new AXIOMXPath(xpathConfig.getXpath());
                        List listOfNodes = xpath.selectNodes(root);
                        StringBuffer value = new StringBuffer();
                        if (listOfNodes != null && listOfNodes.size() > 0) {
                            for (int i = 0; i < listOfNodes.size(); i++) {
                                OMContainer omContainer = (OMContainer) listOfNodes.get(i);

                                if (omContainer instanceof OMDocument) {
                                    omContainer = ((OMDocument) omContainer).getOMDocumentElement();
                                }

                                String xpathValue = omContainer.toString();
                                value.append(xpathValue);
                            }
                        }

                        activity.setXpath(xpathConfig, value.toString());
View Full Code Here

                                    }

                                    listOfNodes = xpath.selectNodes(root);
                                    if (listOfNodes != null && listOfNodes.size() > 0) {
                                        for (int i = 0; i < listOfNodes.size(); i++) {
                                            OMContainer omContainer = (OMContainer) listOfNodes.get(i);

                                            if (omContainer instanceof OMDocument) {
                                                omContainer = ((OMDocument) omContainer).getOMDocumentElement();
                                            }

                                            String xpathValue = omContainer.toString();
                                            xpathValues.put(i + 1, xpathValue);
                                        }
                                        messageData.addValuesForXPath(xpathExp.getKey(), xpathValues);
                                        XPathStore.storeMessageXPathData(messageID, messageData);
                                    }
View Full Code Here

                    }
                   
                }
               

                OMContainer o = om;
                while (o != null && o instanceof OMContainerEx) {
                    ((OMContainerEx)o).setComplete(true);
                    if ((o instanceof OMNode) &&
                            (((OMNode)o).getParent()) instanceof OMContainer) {
                        o = ((OMNode)o).getParent();
View Full Code Here

                    }
                   
                }
               

                OMContainer o = om;
                while (o != null && o instanceof OMContainerEx) {
                    ((OMContainerEx)o).setComplete(true);
                    if ((o instanceof OMNode) &&
                            (((OMNode)o).getParent()) instanceof OMContainer) {
                        o = ((OMNode)o).getParent();
View Full Code Here

     */
    public Object getDocumentNode(Object contextNode) {
        if (contextNode instanceof OMDocument) {
            return contextNode;
        }
        OMContainer parent = ((OMNode) contextNode).getParent();
        if (parent == null) {
            // this node doesn't have a parent Document. So return the document element itself
            return contextNode;
        } else {
            return getDocumentNode(parent);
View Full Code Here

        for (Iterator it = omElement.getAllDeclaredNamespaces(); it.hasNext(); ) {
            seenPrefixes.add(((OMNamespace)it.next()).getPrefix());
        }
        OMElement current = omElement;
        while (true) {
            OMContainer parent = current.getParent();
            if (!(parent instanceof OMElement)) {
                return;
            }
            current = (OMElement)parent;
            for (Iterator it = current.getAllDeclaredNamespaces(); it.hasNext(); ) {
View Full Code Here

        InputStream in = getFileAsStream();
        try {
            OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(),
                    StAXParserConfiguration.PRESERVE_CDATA_SECTIONS, in);
            try {
                OMContainer container = containerFactory.getContainer(builder);
                // We need to clone the InputSource objects so that we can dump their contents
                // if the test fails
                InputSource control[] = duplicateInputSource(containerFactory.getControl(getFileAsStream()));
                InputSource actual[] = duplicateInputSource(serializationMethod.serialize(container));
                try {
                    assertXMLIdentical(compareXML(control[0], actual[0]), true);
                } catch (AssertionFailedError ex) {
                    System.out.println("Control:");
                    dumpInputSource(control[1]);
                    System.out.println("Actual:");
                    dumpInputSource(actual[1]);
                    throw ex;
                }
                if (serializationMethod.isCaching()) {
                    assertTrue(container.isComplete());
                } else {
                    // TODO: need to investigate why assertConsumed is not working here
                    assertFalse(container.isComplete());
//                    assertConsumed(element);
                }
            } finally {
                builder.close();
            }
View Full Code Here

    private Map getAllNamespaces(OMSerializable contextNode) {
        if (contextNode == null) {
            return Collections.EMPTY_MAP;
        }
        OMContainer context;
        if (contextNode instanceof OMContainer) {
            context = (OMContainer)contextNode;
        } else {
            context = ((OMNode)contextNode).getParent();
        }
View Full Code Here

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

TOP

Related Classes of org.apache.axiom.om.OMContainer

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.