use of org.jibx.runtime.IXMLWriter in project spring-framework by spring-projects.
the class JibxMarshaller method marshalDocument.
private void marshalDocument(IMarshallingContext marshallingContext, Object graph) throws IOException, JiBXException {
if (StringUtils.hasLength(docTypeRootElementName)) {
IXMLWriter xmlWriter = marshallingContext.getXmlWriter();
xmlWriter.writeDocType(docTypeRootElementName, docTypeSystemId, docTypePublicId, docTypeInternalSubset);
}
marshallingContext.marshalDocument(graph);
}
use of org.jibx.runtime.IXMLWriter 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);
}
}
Aggregations