Package org.apache.axiom.om.impl.llom

Examples of org.apache.axiom.om.impl.llom.OMTextImpl


        // even if the attachment is SWAREF ?)
        if (isSWA) {
            if (log.isDebugEnabled()){
                log.debug("adding DataHandler for SWA");
            }
            textNode = new OMTextImpl(dh, null);
            // If old SWA attachments, get the ID and add the attachment to message
            cid = textNode.getContentID();
            addDataHandler(dh, cid);  
        } else {
            if (log.isDebugEnabled()){
                log.debug("adding DataHandler for MTOM");
            }
            if (writer instanceof MTOMXMLStreamWriter) {
                textNode = new OMTextImpl(dh, null);
                if(((MTOMXMLStreamWriter) writer).isOptimizedThreshold(textNode)){
                    if (log.isDebugEnabled()){
                        log.debug("The MTOM attachment is written as an attachment part.");
                    }
                    cid = textNode.getContentID();
View Full Code Here


         */
        Iterator itr = currentOMElement.getChildren();
        while (itr.hasNext()) {
            Object node = itr.next();
            if (node instanceof OMTextImpl) {
                OMTextImpl omText = (OMTextImpl) node;
                if (dataHandlerIdList.contains(omText.getContentID())) {
                    return;
                }
            }
        }
        currentOMElement.setText(string);
View Full Code Here

    }

    public static void appendAsTest(byte[] base64Binary, OMElement element) {
        ByteArrayDataSource bads = new ByteArrayDataSource(base64Binary);
        DataHandler dataHandler = new DataHandler(bads);
        OMText text = new OMTextImpl(dataHandler, element.getOMFactory());
        element.addChild(text);
    }
View Full Code Here

                    factory.createOMElement(XKMS2Constants.ELE_REQUEST_SIGNATURE_VALUE);

            DataHandler dataHandler =
                    new DataHandler(
                            new ByteArrayDataSource(requestSignatureValue.getBase64Binary()));
            OMTextImpl omText = new OMTextImpl(dataHandler, true, factory);
            requestSignatureValueEle.addChild(omText);
            String id = requestSignatureValue.getId();
            if (id != null) {
                requestSignatureValueEle.addAttribute(XKMS2Constants.ATTR_ID, id, emptyNs);
            }
View Full Code Here

                OMElement wrapper = soapFactory.createOMElement(wrapperQName, null);

                try {
                    if (message instanceof TextMessage) {
                        OMTextImpl textData = (OMTextImpl) soapFactory.createOMText(
                            ((TextMessage) message).getText());
                        wrapper.addChild(textData);
                    } else if (message instanceof BytesMessage) {
                        BytesMessage bm = (BytesMessage) message;
                        byte[] msgBytes = new byte[(int) bm.getBodyLength()];
View Full Code Here

        OMElement rpcWrapperElement = omFactory.createOMElement("echoOMElement", omNamespace);
        OMElement data = omFactory.createOMElement("data", omNamespace);

        FileDataSource fileDataSource = new FileDataSource(TestingUtils.prefixBaseDirectory("test-resources/mtom/test.jpg"));
        DataHandler expectedDataHandler = new DataHandler(fileDataSource);
        expectedTextData = new OMTextImpl(expectedDataHandler, true, omFactory);
        data.addChild(expectedTextData);
        rpcWrapperElement.addChild(data);
        return rpcWrapperElement;

    }
View Full Code Here

       
        // If this is an MTOMXMLStreamWriter then inform the writer
        // that it must write out this attchment (I guess we should do this
        // even if the attachment is SWAREF ?)
        if (writer instanceof MTOMXMLStreamWriter) {
            textNode = new OMTextImpl(dh, null);
          if(((MTOMXMLStreamWriter) writer).isOptimizedThreshold(textNode)){
            cid = textNode.getContentID();
            ((MTOMXMLStreamWriter) writer).writeOptimized(textNode);
            // Remember the attachment on the message.
            addDataHandler(dh, cid);
View Full Code Here

            if (contentID != null) {//This is an omEnvelope referencing an attachment
                child.build();
                AttachmentPart ap = ((AttachmentPart)attachments.get(contentID.trim()));
                //update the key status as accessed
                keyAccessStatus.put(contentID.trim(), "accessed");
                OMText text = new OMTextImpl(ap.getDataHandler(), true,
                                             omEnvelope.getOMFactory());
                child.removeAttribute(hrefAttr);
                child.addChild(text);
            } else {
                //possibly there can be references in the children of this omEnvelope
View Full Code Here

     * @param parent
     * @param text
     * @return Returns OMText.
     */
    public OMText createOMText(OMContainer parent, String text) {
        return new OMTextImpl(parent, text, this);
    }
View Full Code Here

    public OMText createOMText(OMContainer parent, String text) {
        return new OMTextImpl(parent, text, this);
    }

    public OMText createOMText(OMContainer parent, QName text) {
        return new OMTextImpl(parent, text, this);
    }
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.impl.llom.OMTextImpl

Copyright © 2018 www.massapicom. 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.