Search in sources :

Example 1 with MarshallingContext

use of org.jibx.runtime.impl.MarshallingContext in project spring-framework by spring-projects.

the class JibxMarshaller method marshalXmlStreamWriter.

@Override
protected void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException {
    try {
        MarshallingContext marshallingContext = (MarshallingContext) createMarshallingContext();
        IXMLWriter xmlWriter = new StAXWriter(marshallingContext.getNamespaces(), streamWriter);
        marshallingContext.setXmlWriter(xmlWriter);
        marshallingContext.marshalDocument(graph);
    } catch (JiBXException ex) {
        throw convertJibxException(ex, false);
    }
}
Also used : IXMLWriter(org.jibx.runtime.IXMLWriter) JiBXException(org.jibx.runtime.JiBXException) IMarshallingContext(org.jibx.runtime.IMarshallingContext) MarshallingContext(org.jibx.runtime.impl.MarshallingContext) StAXWriter(org.jibx.runtime.impl.StAXWriter)

Aggregations

IMarshallingContext (org.jibx.runtime.IMarshallingContext)1 IXMLWriter (org.jibx.runtime.IXMLWriter)1 JiBXException (org.jibx.runtime.JiBXException)1 MarshallingContext (org.jibx.runtime.impl.MarshallingContext)1 StAXWriter (org.jibx.runtime.impl.StAXWriter)1