public static void toXML(AuditMessage message, OutputStream os, boolean format, String encoding, String schemaURI) throws IOException { try { Marshaller m = jc().createMarshaller(); if (format) m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); if (schemaURI != null) m.setProperty(Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION, schemaURI); if (encoding != null) m.setProperty(Marshaller.JAXB_ENCODING, encoding); m.marshal(of.createAuditMessage(message), os ); } catch( JAXBException jbe ){ if (jbe.getLinkedException() instanceof IOException) throw (IOException) jbe.getLinkedException(); throw new IllegalStateException(jbe); } }
public static void toXML(AuditMessage message, OutputStream os, boolean format, String encoding, String schemaURI) throws IOException { try { Marshaller m = jc().createMarshaller(); if (format) m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); if (schemaURI != null) m.setProperty(Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION, schemaURI); if (encoding != null) m.setProperty(Marshaller.JAXB_ENCODING, encoding); m.marshal(of.createAuditMessage(message), os ); } catch( JAXBException jbe ){ if (jbe.getLinkedException() instanceof IOException) throw (IOException) jbe.getLinkedException(); throw new IllegalStateException(jbe); } }