use of org.jibx.runtime.JiBXException in project spring-framework by spring-projects.
the class JibxMarshaller method unmarshalXmlStreamReader.
@Override
protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader) {
try {
UnmarshallingContext unmarshallingContext = (UnmarshallingContext) createUnmarshallingContext();
IXMLReader xmlReader = new StAXReaderWrapper(streamReader, null, true);
unmarshallingContext.setDocument(xmlReader);
return unmarshallingContext.unmarshalElement();
} catch (JiBXException ex) {
throw convertJibxException(ex, false);
}
}
use of org.jibx.runtime.JiBXException 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);
}
}
use of org.jibx.runtime.JiBXException in project spring-framework by spring-projects.
the class JibxMarshaller method marshalOutputStream.
// Supported marshalling
@Override
protected void marshalOutputStream(Object graph, OutputStream outputStream) throws XmlMappingException, IOException {
try {
IMarshallingContext marshallingContext = createMarshallingContext();
marshallingContext.startDocument(this.encoding, this.standalone, outputStream);
marshalDocument(marshallingContext, graph);
} catch (JiBXException ex) {
throw convertJibxException(ex, true);
}
}
use of org.jibx.runtime.JiBXException in project spring-framework by spring-projects.
the class JibxMarshaller method marshalWriter.
@Override
protected void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException {
try {
IMarshallingContext marshallingContext = createMarshallingContext();
marshallingContext.startDocument(this.encoding, this.standalone, writer);
marshalDocument(marshallingContext, graph);
} catch (JiBXException ex) {
throw convertJibxException(ex, true);
}
}
Aggregations