Package org.apache.axiom.om

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


            prop.addAttribute(fac.createOMAttribute("name", nullNS, propName));

            if (value instanceof String) {
                prop.addAttribute(fac.createOMAttribute("value", nullNS, (String) value));
            } else if (value instanceof OMElement) {
                prop.addChild((OMElement) value);
            } else {
                handleException("Unable to serialize the command " +
                    "mediator property with the naem " + propName + " : Unknown type");
            }
View Full Code Here


public abstract class AbstractDBMediatorSerializer extends AbstractMediatorSerializer {

    protected void serializeDBInformation(AbstractDBMediator mediator, OMElement dbParent) {

        OMElement connElt = fac.createOMElement("connection", synNS);
        connElt.addChild(createPoolElement(mediator));
        dbParent.addChild(connElt);

        // process statements
        for (Statement statement : mediator.getStatementList()) {
            dbParent.addChild(createStatementElement(statement));
View Full Code Here

            AbstractDBMediatorFactory.STMNT_Q.getLocalPart(), synNS);

        OMElement sqlElt = fac.createOMElement(
            AbstractDBMediatorFactory.SQL_Q.getLocalPart(), synNS);
        OMText sqlText = fac.createOMText(statement.getRawStatement(), XMLStreamConstants.CDATA);
        sqlElt.addChild(sqlText);
        stmntElt.addChild(sqlElt);

        // serialize parameters of the statement
        for (Statement.Parameter param : statement.getParameters()) {
            OMElement paramElt = createStatementParamElement(param);
View Full Code Here

            detail.setText(mediator.getFaultDetail());
        } else if (!mediator.getFaultDetailElements().isEmpty()) {
            OMElement detail = fac.createOMElement("detail", synNS, fault);
            for (OMElement element : mediator.getFaultDetailElements()) {
                if (element != null) {
                    detail.addChild(element.cloneOMElement());
                }
            }
        }

        return fault;
View Full Code Here

            SequenceMediatorSerializer serializer = new SequenceMediatorSerializer();
            serializer.serializeAnonymousSequence(targetElem, target.getSequence());
        }

        if (target.getEndpoint() != null) {
            targetElem.addChild(EndpointSerializer.getElementFromEndpoint(target.getEndpoint()));
        }

        return targetElem;
    }
}
View Full Code Here

            if (list != null) {
                Iterator itr = list.iterator();
                while (itr.hasNext()) {
                    o = itr.next();
                    if (o != null && o instanceof OMElement) {
                        enrichingElement.addChild((OMElement) o);
                    }
                }
            }
        }
    }   
View Full Code Here

        loadbalanceElement.addAttribute(XMLConfigConstants.LOADBALANCE_ALGORITHM,
                loadbalanceEndpoint.getAlgorithm().getClass().getName(),
                null);

        for (Endpoint childEndpoint : loadbalanceEndpoint.getChildren()) {
            loadbalanceElement.addChild(EndpointSerializer.getElementFromEndpoint(childEndpoint));
        }

        return endpointElement;
    }
}
View Full Code Here

        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();
        newElement.build();
        assertEquals(newElement.getText(), text);
View Full Code Here

        String text = "This was a DOOM Text";

        OMElement doomRoot = doomFactory.createOMElement("root", null);
        OMText llomText = llomFactory.createOMText(text);
        OMComment comment = llomFactory.createOMComment(null, "comment");
        doomRoot.addChild(llomText);
        doomRoot.addChild(comment);

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

        OMElement doomRoot = doomFactory.createOMElement("root", null);
        OMText llomText = llomFactory.createOMText(text);
        OMComment comment = llomFactory.createOMComment(null, "comment");
        doomRoot.addChild(llomText);
        doomRoot.addChild(comment);

        OMElement newElement = (OMXMLBuilderFactory.createStAXOMBuilder(this.factory, doomRoot
                .getXMLStreamReader())).getDocumentElement();
        newElement.build();
        assertEquals(newElement.getText(), text);
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.