Search in sources :

Example 1 with XMLAttachmentMarshaller

use of org.eclipse.persistence.oxm.attachment.XMLAttachmentMarshaller in project eclipselink by eclipse-ee4j.

the class SDOXMLHelperDelegate method serialize.

@Override
public void serialize(XMLDocument xmlDocument, OutputStream outputStream, Object options) throws IOException {
    XMLMarshaller xmlMarshaller = getXmlMarshaller();
    XMLAttachmentMarshaller attachmentMarshaller = xmlMarshaller.getAttachmentMarshaller();
    // temporarily null out the attachment marshaller as it should not be used during serialization
    xmlMarshaller.setAttachmentMarshaller(null);
    OutputStreamWriter writer = new OutputStreamWriter(outputStream, xmlMarshaller.getEncoding());
    save(xmlDocument, writer, xmlMarshaller);
    xmlMarshaller.setAttachmentMarshaller(attachmentMarshaller);
}
Also used : XMLMarshaller(org.eclipse.persistence.oxm.XMLMarshaller) XMLAttachmentMarshaller(org.eclipse.persistence.oxm.attachment.XMLAttachmentMarshaller) OutputStreamWriter(java.io.OutputStreamWriter)

Example 2 with XMLAttachmentMarshaller

use of org.eclipse.persistence.oxm.attachment.XMLAttachmentMarshaller in project eclipselink by eclipse-ee4j.

the class LoadAndSaveBase64AttachmentTestCases method setUp.

@Override
public void setUp() {
    super.setUp();
    XMLMarshaller aMarshaller = ((SDOXMLHelper) xmlHelper).getXmlMarshaller();
    XMLUnmarshaller anUnmarshaller = ((SDOXMLHelper) xmlHelper).getXmlUnmarshaller();
    XMLAttachmentMarshaller anAttachmentMarshaller = new AttachmentMarshallerImpl("c_id0");
    XMLAttachmentUnmarshaller anAttachmentUnmarshaller = new AttachmentUnmarshallerImpl("Testing".getBytes());
    aMarshaller.setAttachmentMarshaller(anAttachmentMarshaller);
    anUnmarshaller.setAttachmentUnmarshaller(anAttachmentUnmarshaller);
}
Also used : XMLMarshaller(org.eclipse.persistence.oxm.XMLMarshaller) XMLAttachmentMarshaller(org.eclipse.persistence.oxm.attachment.XMLAttachmentMarshaller) XMLUnmarshaller(org.eclipse.persistence.oxm.XMLUnmarshaller) SDOXMLHelper(org.eclipse.persistence.sdo.helper.SDOXMLHelper) XMLAttachmentUnmarshaller(org.eclipse.persistence.oxm.attachment.XMLAttachmentUnmarshaller)

Example 3 with XMLAttachmentMarshaller

use of org.eclipse.persistence.oxm.attachment.XMLAttachmentMarshaller in project eclipselink by eclipse-ee4j.

the class LoadAndSaveMimeTypeOnPropertyTestCases method setUp.

@Override
public void setUp() {
    super.setUp();
    XMLMarshaller aMarshaller = ((SDOXMLHelper) xmlHelper).getXmlMarshaller();
    XMLUnmarshaller anUnmarshaller = ((SDOXMLHelper) xmlHelper).getXmlUnmarshaller();
    XMLAttachmentMarshaller anAttachmentMarshaller = new AttachmentMarshallerImpl("c_id0");
    XMLAttachmentUnmarshaller anAttachmentUnmarshaller = new AttachmentUnmarshallerImpl("Testing".getBytes());
    aMarshaller.setAttachmentMarshaller(anAttachmentMarshaller);
    anUnmarshaller.setAttachmentUnmarshaller(anAttachmentUnmarshaller);
}
Also used : XMLMarshaller(org.eclipse.persistence.oxm.XMLMarshaller) XMLAttachmentMarshaller(org.eclipse.persistence.oxm.attachment.XMLAttachmentMarshaller) XMLUnmarshaller(org.eclipse.persistence.oxm.XMLUnmarshaller) SDOXMLHelper(org.eclipse.persistence.sdo.helper.SDOXMLHelper) XMLAttachmentUnmarshaller(org.eclipse.persistence.oxm.attachment.XMLAttachmentUnmarshaller)

Example 4 with XMLAttachmentMarshaller

use of org.eclipse.persistence.oxm.attachment.XMLAttachmentMarshaller in project eclipselink by eclipse-ee4j.

the class LoadAndSaveMimeTypeOnPropertyManyTestCases method setUp.

@Override
public void setUp() {
    super.setUp();
    XMLMarshaller aMarshaller = ((SDOXMLHelper) xmlHelper).getXmlMarshaller();
    XMLUnmarshaller anUnmarshaller = ((SDOXMLHelper) xmlHelper).getXmlUnmarshaller();
    XMLAttachmentMarshaller anAttachmentMarshaller = new AttachmentMarshallerImpl("c_id0");
    XMLAttachmentUnmarshaller anAttachmentUnmarshaller = new AttachmentUnmarshallerImpl("Testing".getBytes());
    aMarshaller.setAttachmentMarshaller(anAttachmentMarshaller);
    anUnmarshaller.setAttachmentUnmarshaller(anAttachmentUnmarshaller);
}
Also used : XMLMarshaller(org.eclipse.persistence.oxm.XMLMarshaller) XMLAttachmentMarshaller(org.eclipse.persistence.oxm.attachment.XMLAttachmentMarshaller) XMLUnmarshaller(org.eclipse.persistence.oxm.XMLUnmarshaller) SDOXMLHelper(org.eclipse.persistence.sdo.helper.SDOXMLHelper) XMLAttachmentUnmarshaller(org.eclipse.persistence.oxm.attachment.XMLAttachmentUnmarshaller)

Example 5 with XMLAttachmentMarshaller

use of org.eclipse.persistence.oxm.attachment.XMLAttachmentMarshaller in project eclipselink by eclipse-ee4j.

the class LoadAndSaveMimeTypeOnXSDManyTestCases method setUp.

@Override
public void setUp() {
    super.setUp();
    XMLMarshaller aMarshaller = ((SDOXMLHelper) xmlHelper).getXmlMarshaller();
    XMLUnmarshaller anUnmarshaller = ((SDOXMLHelper) xmlHelper).getXmlUnmarshaller();
    XMLAttachmentMarshaller anAttachmentMarshaller = new AttachmentMarshallerImpl("c_id0");
    XMLAttachmentUnmarshaller anAttachmentUnmarshaller = new AttachmentUnmarshallerImpl("Testing".getBytes());
    aMarshaller.setAttachmentMarshaller(anAttachmentMarshaller);
    anUnmarshaller.setAttachmentUnmarshaller(anAttachmentUnmarshaller);
}
Also used : XMLMarshaller(org.eclipse.persistence.oxm.XMLMarshaller) XMLAttachmentMarshaller(org.eclipse.persistence.oxm.attachment.XMLAttachmentMarshaller) XMLUnmarshaller(org.eclipse.persistence.oxm.XMLUnmarshaller) SDOXMLHelper(org.eclipse.persistence.sdo.helper.SDOXMLHelper) XMLAttachmentUnmarshaller(org.eclipse.persistence.oxm.attachment.XMLAttachmentUnmarshaller)

Aggregations

XMLMarshaller (org.eclipse.persistence.oxm.XMLMarshaller)6 XMLAttachmentMarshaller (org.eclipse.persistence.oxm.attachment.XMLAttachmentMarshaller)6 XMLUnmarshaller (org.eclipse.persistence.oxm.XMLUnmarshaller)5 XMLAttachmentUnmarshaller (org.eclipse.persistence.oxm.attachment.XMLAttachmentUnmarshaller)5 SDOXMLHelper (org.eclipse.persistence.sdo.helper.SDOXMLHelper)5 OutputStreamWriter (java.io.OutputStreamWriter)1