Search in sources :

Example 1 with ObjectPersistenceRuntimeXMLProject_11_1_1

use of org.eclipse.persistence.internal.sessions.factories.ObjectPersistenceRuntimeXMLProject_11_1_1 in project eclipselink by eclipse-ee4j.

the class OXTestCase method write.

// Write out deployment XML
public void write(Project project, Writer writer) {
    // Write out EclipseLink deployment XML
    if (metadata == Metadata.XML_ECLIPSELINK) {
        XMLProjectWriter.write(project, writer);
        return;
    }
    // Write out TL deployment XML
    XMLContext context = new XMLContext(new ObjectPersistenceRuntimeXMLProject_11_1_1());
    context.getSession(project).getEventManager().addListener(new MissingDescriptorListener());
    XMLMarshaller marshaller = context.createMarshaller();
    marshaller.marshal(project, writer);
    try {
        writer.flush();
    } catch (IOException exception) {
        throw ValidationException.fileError(exception);
    }
}
Also used : XMLContext(org.eclipse.persistence.oxm.XMLContext) XMLMarshaller(org.eclipse.persistence.oxm.XMLMarshaller) ObjectPersistenceRuntimeXMLProject_11_1_1(org.eclipse.persistence.internal.sessions.factories.ObjectPersistenceRuntimeXMLProject_11_1_1) MissingDescriptorListener(org.eclipse.persistence.internal.sessions.factories.MissingDescriptorListener) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 MissingDescriptorListener (org.eclipse.persistence.internal.sessions.factories.MissingDescriptorListener)1 ObjectPersistenceRuntimeXMLProject_11_1_1 (org.eclipse.persistence.internal.sessions.factories.ObjectPersistenceRuntimeXMLProject_11_1_1)1 XMLContext (org.eclipse.persistence.oxm.XMLContext)1 XMLMarshaller (org.eclipse.persistence.oxm.XMLMarshaller)1