Examples of OMNode


Examples of org.apache.axiom.om.OMNode

        child.setParent(container);

        if (container.getFirstOMChildIfAvailable() == null) {
            container.setFirstChild(child);
        } else {
            OMNode lastChild = container.getLastKnownOMChild();
            child.setPreviousOMSibling(lastChild);
            ((OMNodeEx)lastChild).setNextOMSibling(child);
        }
        container.setLastChild(child);
View Full Code Here

Examples of org.apache.axiom.om.OMNode

            }        
        }
    }
   
    public static OMNode getFirstOMChild(IParentNode that) {
        OMNode firstChild = that.getFirstOMChildIfAvailable();
        if (firstChild == null) {
            switch (that.getState()) {
                case IParentNode.DISCARDED:
                    ((StAXBuilder)that.getBuilder()).debugDiscarded(that);
                    throw new NodeUnavailableException();
View Full Code Here

Examples of org.apache.axiom.om.OMNode

    }
   
    public static void removeChildren(IContainer that) {
        boolean updateState;
        if (that.getState() == IParentNode.INCOMPLETE && that.getBuilder() != null) {
            OMNode lastKnownChild = that.getLastKnownOMChild();
            if (lastKnownChild != null) {
                lastKnownChild.build();
            }
            ((StAXOMBuilder)that.getBuilder()).discard(that);
            updateState = true;
        } else {
            updateState = false;
View Full Code Here

Examples of org.apache.axiom.om.OMNode

        SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(attachments);
        OMDocument doc = builder.getDocument();
        // Find all the binary nodes
        List/*<OMText>*/ binaryNodes = new ArrayList();
        for (Iterator it = doc.getDescendants(false); it.hasNext(); ) {
            OMNode node = (OMNode)it.next();
            if (node instanceof OMText) {
                OMText text = (OMText)node;
                if (text.isBinary()) {
                    binaryNodes.add(text);
                }
View Full Code Here

Examples of org.apache.axiom.om.OMNode

        element.setText(qname);

        assertEquals("ns:test", element.getText());

        // Check that OMElement#setText() has created the expected nodes
        OMNode child = element.getFirstOMChild();
        assertTrue(child instanceof OMText);
        assertSame(element, child.getParent());
        assertEquals("ns:test", ((OMText)child).getText());
        assertNull(child.getNextOMSibling());
    }
View Full Code Here

Examples of org.apache.axiom.om.OMNode

    public static void walkThrough(OMElement element) {
        Assert.assertFalse("Expected " + element.getQName() + " to be incomplete", element.isComplete());
        for (Iterator it = element.getAllAttributes(); it.hasNext(); ) {
            Assert.assertNotNull(it.next());
        }
        OMNode child = element.getFirstOMChild();
        while (child != null) {
            if (child instanceof OMElement) {
                walkThrough((OMElement)child);
            }
            child = child.getNextOMSibling();
        }
        Assert.assertTrue(element.isComplete());
    }
View Full Code Here

Examples of org.apache.axiom.om.OMNode

        super(metaFactory, spec);
    }

    protected void runTest() throws Throwable {
        SOAPMessage message = (SOAPMessage)getBuilderForTestMessage(SOAP_MESSAGE).getDocument();
        OMNode firstChild = message.getFirstOMChild();
        assertTrue(firstChild instanceof OMComment);
    }
View Full Code Here

Examples of org.apache.axiom.om.OMNode

    }

    protected void runTest() throws Throwable {
        SOAPEnvelope envelope = OMXMLBuilderFactory.createSOAPModelBuilder(metaFactory,
                new StringReader(soapFactory.getDefaultEnvelope() + "<!--comment-->")).getSOAPEnvelope();
        OMNode sibling = envelope.getNextOMSibling();
        assertTrue(sibling instanceof OMComment);
    }
View Full Code Here

Examples of org.apache.axiom.om.OMNode

        generatePrefixMappingEvents(omElement, false);
    }
   
    private void generateEventsForChildren(OMContainer parent) throws SAXException {
        for (Iterator it = parent.getChildren(); it.hasNext(); ) {
            OMNode node = (OMNode)it.next();
            switch (node.getType()) {
                case OMNode.DTD_NODE:
                    if (lexicalHandler != null) {
                        OMDocType doctype = (OMDocType)node;
                        lexicalHandler.startDTD(doctype.getRootName(), doctype.getPublicId(), doctype.getSystemId());
                        lexicalHandler.endDTD();
                    }
                    break;
                case OMNode.ELEMENT_NODE:
                    generateEvents((OMElement)node);
                    break;
                case OMNode.TEXT_NODE:
                    generateEvents((OMText)node, false);
                    break;
                case OMNode.SPACE_NODE:
                    generateEvents((OMText)node, true);
                    break;
                case OMNode.CDATA_SECTION_NODE:
                    if (lexicalHandler != null) {
                        lexicalHandler.startCDATA();
                    }
                    generateEvents((OMText)node, false);
                    if (lexicalHandler != null) {
                        lexicalHandler.endCDATA();
                    }
                    break;
                case OMNode.COMMENT_NODE:
                    if (lexicalHandler != null) {
                        char[] ch = ((OMComment)node).getValue().toCharArray();
                        lexicalHandler.comment(ch, 0, ch.length);
                    }
                    break;
                case OMNode.PI_NODE:
                    OMProcessingInstruction pi = (OMProcessingInstruction)node;
                    contentHandler.processingInstruction(pi.getTarget(), pi.getValue());
                    break;
                case OMNode.ENTITY_REFERENCE_NODE:
                    contentHandler.skippedEntity(((OMEntityReference)node).getName());
                    break;
                default:
                    throw new IllegalStateException("Unrecognized node type " + node.getType());
            }
        }
    }
View Full Code Here

Examples of org.apache.axiom.om.OMNode

                isIgnorable(elementTwo)) {
            return;
        }
        Iterator elementOneChildren = elementOne.getChildren();
        while (elementOneChildren.hasNext()) {
            OMNode omNode = (OMNode) elementOneChildren.next();
            if (omNode instanceof OMElement) {
                OMElement elementOneChild = (OMElement) omNode;
                OMElement elementTwoChild = null;
                //Do the comparison only if the element is not ignorable
                if (!isIgnorable(elementOneChild)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.