Package javax.xml.bind.attachment

Examples of javax.xml.bind.attachment.AttachmentMarshaller


                    }
                }
            }
           
            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

           
            // Very easy, use the Context to get the Marshaller.
            // Use the marshaller to write the object.
            Marshaller m = JAXBUtils.getJAXBMarshaller(getJAXBContext(cl));
           
            AttachmentMarshaller am = createAttachmentMarshaller(writer);
            if (am != null) {
                if (DEBUG_ENABLED) {
                    log.debug("Adding JAXBAttachmentMarshaller to Marshaller");
                }
                m.setAttachmentMarshaller(am);
            }


            // Marshal the object
            if (getProcessType() == null) {
                marshalByElement(obj,
                                 m,
                                 writer,
                                 !am.isXOPPackage());
            } else {
                marshalByType(obj,
                              m,
                              writer,
                              getProcessType(),
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

    public void marshal(Object obj, XMLStreamWriter writer) throws JAXBException {

        // Very easy, use the Context to get the Marshaller.
        // Use the marshaller to write the object.
        Marshaller m = JAXBContextHelper.getMarshaller(getJAXBContext());
        AttachmentMarshaller am = m.getAttachmentMarshaller();
        boolean xop = am != null ? am.isXOPPackage() : false;
        // Marshal the object
        marshalElement(obj, m, writer, !xop);
    }
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

           
            // Very easy, use the Context to get the Marshaller.
            // Use the marshaller to write the object.
            Marshaller m = JAXBUtils.getJAXBMarshaller(getJAXBContext(cl));
           
            AttachmentMarshaller am = createAttachmentMarshaller(writer);
            if (am != null) {
                if (DEBUG_ENABLED) {
                    log.debug("Adding JAXBAttachmentMarshaller to Marshaller");
                }
                m.setAttachmentMarshaller(am);
View Full Code Here

    public void marshal(Object obj, XMLStreamWriter writer) throws JAXBException {

        // Very easy, use the Context to get the Marshaller.
        // Use the marshaller to write the object.
        Marshaller m = JAXBContextHelper.getMarshaller(getJAXBContext());
        AttachmentMarshaller am = m.getAttachmentMarshaller();
        boolean xop = am != null ? am.isXOPPackage() : false;
        // Marshal the object
        marshalElement(obj, m, writer, !xop);
    }
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.