Package javax.xml.bind.attachment

Examples of javax.xml.bind.attachment.AttachmentMarshaller


        return au.getAttachmentAsDataHandler(cid);
    }

    public String marshal(DataHandler data) {
        if(data==null)      return null;
        AttachmentMarshaller am = XMLSerializer.getInstance().attachmentMarshaller;
        // TODO: error check
        return am.addSwaRefAttachment(data);
    }
View Full Code Here


    }

    public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException {
        try {
            // MtomCodec sets its own AttachmentMarshaller
            AttachmentMarshaller am = (sw instanceof MtomStreamWriter)
                    ? ((MtomStreamWriter)sw).getAttachmentMarshaller()
                    : new AttachmentMarshallerImpl(attachmentSet);

            // Get output stream and use JAXB UTF-8 writer
            OutputStream os = XMLStreamWriterUtil.getOutputStream(sw);
View Full Code Here

         * JAXBMessage writes envelope directly to the OutputStream(for SJSXP, woodstox).
         * While writing, it calls the AttachmentMarshaller methods for adding attachments.
         * JAXB writes xop:Include in this case.
         */
        public AttachmentMarshaller getAttachmentMarshaller() {
            return new AttachmentMarshaller() {

                public String addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName) {
                    // Should we do the threshold processing on DataHandler ? But that would be
                    // expensive as DataHolder need to read the data again from its source
                    ByteArrayBuffer bab = new ByteArrayBuffer(data);
View Full Code Here

    @Override
    public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException {
        try {
            // MtomCodec sets its own AttachmentMarshaller
            AttachmentMarshaller am = (sw instanceof MtomStreamWriter)
                    ? ((MtomStreamWriter)sw).getAttachmentMarshaller()
                    : new AttachmentMarshallerImpl(attachmentSet);

            // Get the encoding of the writer
            String encoding = XMLStreamWriterUtil.getEncoding(sw);
View Full Code Here

    @Override
    @SuppressWarnings("unchecked")
    public void writeTo(XMLStreamWriter sw) throws XMLStreamException {
        try {
            // MtomCodec sets its own AttachmentMarshaller
            AttachmentMarshaller am = (sw instanceof MtomStreamWriter)
                    ? ((MtomStreamWriter) sw).getAttachmentMarshaller()
                    : new AttachmentMarshallerImpl(attachmentSet);

            // Get the encoding of the writer
            String encoding = XMLStreamWriterUtil.getEncoding(sw);
View Full Code Here

         * While writing, it calls the AttachmentMarshaller methods for adding attachments.
         * JAXB writes xop:Include in this case.
         */
        @Override
        public AttachmentMarshaller getAttachmentMarshaller() {
            return new AttachmentMarshaller() {

                @Override
                public String addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName) {
                    // Should we do the threshold processing on DataHandler ? But that would be
                    // expensive as DataHolder need to read the data again from its source
View Full Code Here

                    }
                }
            }
           
            marshaller.setSchema(schema);
            AttachmentMarshaller atmarsh = getAttachmentMarshaller();
            marshaller.setAttachmentMarshaller(atmarsh);
           
            if (schema != null
                && atmarsh instanceof JAXBAttachmentMarshaller) {
                //we need a special even handler for XOP attachments
View Full Code Here

                    }
                }
            }
           
            marshaller.setSchema(schema);
            AttachmentMarshaller atmarsh = getAttachmentMarshaller();
            marshaller.setAttachmentMarshaller(atmarsh);
           
            if (schema != null
                && atmarsh instanceof JAXBAttachmentMarshaller) {
                //we need a special even handler for XOP attachments
View Full Code Here

                    }
                }
            }
           
            marshaller.setSchema(schema);
            AttachmentMarshaller atmarsh = getAttachmentMarshaller();
            marshaller.setAttachmentMarshaller(atmarsh);
           
            if (schema != null
                && atmarsh instanceof JAXBAttachmentMarshaller) {
                //we need a special even handler for XOP attachments
View Full Code Here

                    }
                }
            }
           
            marshaller.setSchema(schema);
            AttachmentMarshaller atmarsh = getAttachmentMarshaller();
            marshaller.setAttachmentMarshaller(atmarsh);
           
            if (schema != null
                && atmarsh instanceof JAXBAttachmentMarshaller) {
                //we need a special even handler for XOP attachments
View Full Code Here

TOP

Related Classes of javax.xml.bind.attachment.AttachmentMarshaller

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.