Package org.apache.axiom.om

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


  public static void setBinaryPayload(SOAPEnvelope envelope, DataHandler dh) {
    OMFactory fac = envelope.getOMFactory();
    OMElement binaryElt = envelope.getOMFactory()
        .createOMElement(BINARYELT);
    OMText text = fac.createOMText(dh, true);
    binaryElt.addChild(text);
    setXMLPayload(envelope, binaryElt);
  }

  public static void setBinaryPayload(MessageContext mc, DataHandler dh) {
    if (mc.getEnvelope() == null) {
View Full Code Here


  public static void setTextPayload(SOAPEnvelope envelope, String text) {
    OMFactory fac = envelope.getOMFactory();
    OMElement textElt = envelope.getOMFactory().createOMElement(TEXTELT);
    OMText textNode = fac.createOMText(text);
    textElt.addChild(textNode);
    setXMLPayload(envelope, textElt);
  }

  public static void setTextPayload(MessageContext mc, String text) {
    if (mc.getEnvelope() == null) {
View Full Code Here

        } else {
            script.addAttribute(fac.createOMAttribute("language", nullNS, language));
            OMTextImpl textData = (OMTextImpl) fac.createOMText(
                    scriptMediator.getScriptSrc().trim());
            textData.setType(XMLStreamConstants.CDATA);
            script.addChild(textData);
        }

        Map<String, Object> includeMap = scriptMediator.getIncludeMap();
        for (String includeKey : includeMap.keySet()) {
            if (includeKey != null && includeKey.length() != 0) {
View Full Code Here

                    entry.setText(o.toString());
                } else if (o instanceof byte[]) {
                    entry.addAttribute(TYPE, BYTEARRAY, attrNS);
                    OMText text = fac.createOMText(new DataHandler(
                            new ByteArrayDataSource((byte[]) o)), true);
                    entry.addChild(text);
                } else if (o instanceof Float) {
                    entry.addAttribute(TYPE, FLOAT, attrNS);
                    entry.setText(o.toString());
                } else if (o instanceof Double) {
                    entry.addAttribute(TYPE, DOUBLE, attrNS);
View Full Code Here

        OMElement send = fac.createOMElement("send", synNS);
        saveTracingState(send, mediator);

        Endpoint activeEndpoint = mediator.getEndpoint();
        if (activeEndpoint != null) {
            send.addChild(EndpointSerializer.getElementFromEndpoint(activeEndpoint));
        }

        return send;
    }
View Full Code Here

        serializeCommonAttributes(endpoint,endpointElement);


        for (Endpoint childEndpoint : failoverEndpoint.getChildren()) {
            failoverElement.addChild(EndpointSerializer.getElementFromEndpoint(childEndpoint));
        }

        return endpointElement;
    }
}
View Full Code Here

        if (itrMed.getTarget() != null && !itrMed.getTarget().isAsynchronous()) {
            itrElem.addAttribute("sequential", "false", nullNS);
        }

        itrElem.addChild(TargetSerializer.serializeTarget(itrMed.getTarget()));

        return itrElem;
    }

    /**
 
View Full Code Here

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

            if (o instanceof String) {
                prop.addAttribute(fac.createOMAttribute("value", nullNS, (String) o));
            } else {
                prop.addChild((OMNode) o);
            }
            clazz.addChild(prop);
        }

        return clazz;
View Full Code Here

        if (mediator.getValue() != null) {
            property.addAttribute(fac.createOMAttribute(
                    "value", nullNS, mediator.getValue().toString()));
        } else if (mediator.getValueElement() != null) {
            property.addChild(mediator.getValueElement());
        } else if (mediator.getExpression() != null) {
            SynapseXPathSerializer.serializeXPath(mediator.getExpression(),
                    property, "expression");
        } else if (mediator.getAction() == PropertyMediator.ACTION_SET) {
            handleException("Invalid property mediator. Value or expression is required if " +
View Full Code Here

        }

        for (Iterator itr = clone.getTargets().iterator(); itr.hasNext();) {
            Object o = itr.next();
            if (o instanceof Target) {
                cloneElem.addChild(TargetSerializer.serializeTarget((Target) o));
            }
        }

        return cloneElem;
    }
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.