| java.lang.Object org.jaffa.tools.patternmetaengine.JAXBHelper
JAXBHelper | public class JAXBHelper (Code) | | This contains functions that augment the capability of the JAXB Marshalling
framework
author: PaulE |
marshalWithDocType | public static void marshalWithDocType(Marshaller m, Element source, OutputStream out, String rootNode, String publicId, String systemId) throws JAXBException(Code) | | This does the same job as javax.xml.bind.Marshaller.marshal(object, OutputStream)
except it allows a DOCTYPE to be included in the output, so the XML can be validated
using a DTD with a regular SAX parser. It also overrides the JAB generated
declaration, as the DOCTYPE reference no longer makes the XML standalone!. The encoding
is also set to UTF-8, the same as the JAXB default.
Future enchanments could be
1) Support SYSTEM doctypes, this is only doing PUBLIC right now
2) Allow the encoding scheme to be passed in
3) Infer the root node from the XML, and remove it as an input parameter
Parameters: m - Marshaller to use Parameters: source - Source Element to be Marshalled Parameters: out - OutputStream to write XML to Parameters: rootNode - Name of the root tag in the XML for the DOCTYPE declaration Parameters: publicId - Public Id for the DOCTYPE declaration Parameters: systemId - System Id for the DOCTYPE declaration throws: JAXBException - Thrown if a Marshalling error occurs |
showErrors | public static void showErrors(Logger log, ValidationEventCollector vec)(Code) | | Write a JAXB Validation Error Out to the Logger
Parameters: log - Logger to output errors to Parameters: vec - Validation Event Collection generated by JAXB |
|
|