Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMElement.build()


            if (builder instanceof StAXBuilder) {
                ((StAXBuilder)builder).releaseParserOnClose(true);
            }
            OMElement document = builder.getDocumentElement();
            if (document != null) {
                document.build();
            }
        }
        if (builder instanceof StAXBuilder) {
            ((StAXBuilder)builder).close();
        }
View Full Code Here


            case (OMNode.ELEMENT_NODE): {
                OMElement childElement = (OMElement) child;
                OMElement newElement = (new StAXOMBuilder(this.factory,
                                                          childElement.getXMLStreamReader()))
                        .getDocumentElement();
                newElement.build();
                return (OMNode) this.ownerNode.importNode((Element) newElement,
                                                          true);
            }
            case (OMNode.TEXT_NODE): {
                OMText importedText = (OMText) child;
View Full Code Here

            log.debug("  newBuilder = " + newBuilder);
        }
       
        // Build the (target) clonedElement from the parser
        OMElement clonedElement = newBuilder.getDocumentElement();
        clonedElement.build();
        return clonedElement;
    }

    public void setLineNumber(int lineNumber) {
        this.lineNumber = lineNumber;
View Full Code Here

    }

    protected void runTest() throws Throwable {
        OMElement root = AXIOMUtil.stringToOM(metaFactory.getOMFactory(), "<root><a/><b/><c/></root>");
        if (build) {
            root.build();
        } else {
            assertFalse(root.isComplete());
        }
        OMElement a = (OMElement)root.getFirstOMChild();
        assertEquals("a", a.getLocalName());
View Full Code Here

        if (omElement.getOMFactory().getClass().isInstance(omFactory)) {
            return omElement;
        } else {
            OMElement documentElement = new StAXOMBuilder(omFactory, omElement.getXMLStreamReader())
                    .getDocumentElement();
            documentElement.build();
            return documentElement;
        }
    }

    /**
 
View Full Code Here

        XMLStreamReader reader = StAXUtils.createXMLStreamReader(StAXParserConfiguration.NON_COALESCING, is);
       
        OMElement element = omMetaFactory.createStAXOMBuilder(omMetaFactory.getOMFactory(), reader).getDocumentElement();
       
        // Build the element so we have a full StAX tree
        element.build();
       
        // Get the XMLStreamReader for the element. This will return an OMStAXWrapper.
        XMLStreamReader reader2 = element.getXMLStreamReader();
        // Check the sequence of events
        int event = reader2.next();
View Full Code Here

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement element = OMXMLBuilderFactory.createOMBuilder(factory,
                new StringReader("<root><a>A</a><b>B</b></root>")).getDocumentElement();
        if (complete) {
            element.build();
        }
        OMElement firstChild = (OMElement)element.getFirstOMChild();
        assertEquals(complete, element.isComplete());
        assertEquals(complete, firstChild.isComplete());
        element.removeChildren();
View Full Code Here

                OMElement element =
                    OMXMLBuilderFactory.createStAXOMBuilder(reader).getDocumentElement();
                // Make sure that all events belonging to the element are consumed so that
                // that the XMLStreamReader points to a well defined location (namely the
                // event immediately following the END_ELEMENT event).
                element.build();
                // Now process the element.
                processFragment(element);
            } else {
                reader.next();
            }
View Full Code Here

                   output.indexOf(payload1) > 0);
        assertTrue("OMSourcedElement is expanded.  This is unexpected", !child.isExpanded());
       
        // If a consumer calls build or buildWithAttachments on the tree, the
        // tree should not be expanded.
        parent.build();
        assertTrue("OMSourcedElement is expanded after build().  This is unexpected", !child.isExpanded());
        parent.buildWithAttachments();
        assertTrue("OMSourcedElement is expanded after buildWithAttachments().  This is unexpected", !child.isExpanded());
       
        // Test getting the raw bytes from the ByteArrayDataSource.
View Full Code Here

        // (the pull stream parsing was not pulling the final tag).
        // Three things need to occur:
        //   a) analyze fix the serialization/pull stream problem.
        //   b) add a method signature to allow the caller to request build or no build
        //   c) add a method signature to allow the caller to enable/disable caching
        om.build();
        return om;
    }

    /* (non-Javadoc)
      * @see org.apache.axis2.jaxws.message.util.SAAJConverter#toSAAJ(org.apache.axiom.om.OMElement, javax.xml.soap.SOAPElement)
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.