Examples of createOMElement()


Examples of org.apache.axiom.om.OMFactory.createOMElement()

    public void testAddDOOMElementAsChild() throws XMLStreamException {
        OMFactory doomFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
        OMFactory llomFactory = OMAbstractFactory.getOMFactory();
        String text = "This was a DOOM Text";

        OMElement llomRoot = llomFactory.createOMElement("root", null);
        OMElement doomElement = doomFactory.createOMElement("second", "test", "a");
        doomElement.setText(text);
        llomRoot.addChild(doomElement);

        OMElement newElement = (OMXMLBuilderFactory.createStAXOMBuilder(this.factory, llomRoot
View Full Code Here

Examples of org.apache.axiom.om.OMFactory.createOMElement()

        OMFactory factory = OMAbstractFactory.getOMFactory();
        JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
        DocumentBean orgBean = new DocumentBean();
        orgBean.setId("AB23498");
        orgBean.setContent(new DataHandler("test content", "text/plain"));
        OMElement element = factory.createOMElement(new JAXBOMDataSource(context, orgBean));
        DocumentBean bean = (DocumentBean)JAXBUtils.unmarshal(context, element, true);
        assertEquals(orgBean.getId(), bean.getId());
        assertEquals(orgBean.getContent(), bean.getContent());
    }
}
View Full Code Here

Examples of org.apache.axiom.om.OMFactory.createOMElement()

    public void testAddDOOMTextAsChild() throws XMLStreamException {
        OMFactory doomFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
        OMFactory llomFactory = OMAbstractFactory.getOMFactory();
        String text = "This was a DOOM Text";

        OMElement llomRoot = llomFactory.createOMElement("root", null);
        OMText doomText = doomFactory.createOMText(text);
        llomRoot.addChild(doomText);

        OMElement newElement = (OMXMLBuilderFactory.createStAXOMBuilder(this.factory, llomRoot
                .getXMLStreamReader())).getDocumentElement();
View Full Code Here

Examples of org.apache.axiom.om.OMFactory.createOMElement()

        super(metaFactory);
    }

    protected void runTest() throws Throwable {
        OMFactory fac = metaFactory.getOMFactory();
        OMElement elem = fac.createOMElement("RequestSecurityToken",
                fac.createOMNamespace("http://schemas.xmlsoap.org/ws/2005/02/trust", ""));
        fac.createOMElement(new QName("TokenType"), elem).setText("test");
        fac.createOMElement(new QName("RequestType"), elem).setText("test1");

        fac.createOMElement(
View Full Code Here

Examples of org.apache.axiom.om.OMFactory.createOMElement()

        OMFactory doomFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory();
        OMFactory llomFactory = OMAbstractFactory.getOMFactory();
        String text = "This was a LLOM Text";

        OMElement doomRoot = doomFactory.createOMElement("root", null);
        OMElement llomElement = llomFactory.createOMElement("second", "test", "a");
        llomElement.setText(text);
        doomRoot.addChild(llomElement);

        OMElement newElement = (OMXMLBuilderFactory.createStAXOMBuilder(this.factory, doomRoot
                .getXMLStreamReader())).getDocumentElement();
View Full Code Here

Examples of org.apache.axiom.om.OMFactory.createOMElement()

    protected void runTest() throws Throwable {
        OMFactory fac = metaFactory.getOMFactory();
        OMElement elem = fac.createOMElement("RequestSecurityToken",
                fac.createOMNamespace("http://schemas.xmlsoap.org/ws/2005/02/trust", ""));
        fac.createOMElement(new QName("TokenType"), elem).setText("test");
        fac.createOMElement(new QName("RequestType"), elem).setText("test1");

        fac.createOMElement(
                new QName("http://schemas.xmlsoap.org/ws/2005/02/trust", "Entropy", "wst"),
                elem);
View Full Code Here

Examples of org.apache.axiom.om.OMFactory.createOMElement()

    protected void runTest() throws Throwable {
        OMFactory fac = metaFactory.getOMFactory();
        OMElement elem = fac.createOMElement("RequestSecurityToken",
                fac.createOMNamespace("http://schemas.xmlsoap.org/ws/2005/02/trust", ""));
        fac.createOMElement(new QName("TokenType"), elem).setText("test");
        fac.createOMElement(new QName("RequestType"), elem).setText("test1");

        fac.createOMElement(
                new QName("http://schemas.xmlsoap.org/ws/2005/02/trust", "Entropy", "wst"),
                elem);
        String xml = elem.toString();
View Full Code Here

Examples of org.apache.axiom.om.OMFactory.createOMElement()

        OMElement elem = fac.createOMElement("RequestSecurityToken",
                fac.createOMNamespace("http://schemas.xmlsoap.org/ws/2005/02/trust", ""));
        fac.createOMElement(new QName("TokenType"), elem).setText("test");
        fac.createOMElement(new QName("RequestType"), elem).setText("test1");

        fac.createOMElement(
                new QName("http://schemas.xmlsoap.org/ws/2005/02/trust", "Entropy", "wst"),
                elem);
        String xml = elem.toString();

        OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(),
View Full Code Here

Examples of org.apache.axiom.om.OMFactory.createOMElement()

        super(metaFactory);
    }

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement element = factory.createOMElement(new QName("test"));
        OMNamespace ns = factory.createOMNamespace("urn:test", "p");
        element.setNamespace(ns);
        assertEquals(new QName("urn:test", "test"), element.getQName());
        assertEquals(ns, element.getNamespace());
        Iterator it = element.getAllDeclaredNamespaces();
View Full Code Here

Examples of org.apache.axiom.om.OMFactory.createOMElement()

        super(metaFactory);
    }

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement element = factory.createOMElement("test", null);
        OMText text = factory.createOMText("test");
        element.addChild(text);
        assertSame(element, text.getParent());
        assertSame(text, element.getFirstOMChild());
    }
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.