Class JAXBWriter


  • public class JAXBWriter
    extends Object
    Writes Elementobjects to an XML stream. Element instances can be created using the ObjectFactory that is generated by the JAXB compiler.
    See Also:
    XMLWriter, JAXBContext
    • Constructor Detail

      • JAXBWriter

        public JAXBWriter​(String contextPath)
        Creates a new JAXBWriter for the given JAXB context path. This is the Java package where JAXB can find the generated XML classes. This package MUST contain jaxb.properties!
        Parameters:
        contextPath - JAXB context path to be used
        See Also:
        JAXBContext
      • JAXBWriter

        public JAXBWriter​(String contextPath,
                          OutputFormat outputFormat)
        Creates a new JAXBWriter for the given JAXB context path. The specied OutputFormatwill be used for writing the XML stream.
        Parameters:
        contextPath - JAXB context path to be used
        outputFormat - the DOM4J OutputFormatto be used
        See Also:
        JAXBContext
      • JAXBWriter

        public JAXBWriter​(String contextPath,
                          ClassLoader classloader)
        Creates a new JAXBWriter for the given JAXB context path, using the specified ClassLoader. (This is the Java package where JAXB can find the generated XML classes. This package MUST contain jaxb.properties!)
        Parameters:
        contextPath - JAXB context path to be used
        classloader - the classloader to be used for loading JAXB
        See Also:
        JAXBContext
      • JAXBWriter

        public JAXBWriter​(String contextPath,
                          ClassLoader classloader,
                          OutputFormat outputFormat)
        Creates a new JAXBWriter for the given JAXB context path, using the specified ClassLoader. The specied OutputFormat will be used while writing the XML stream.
        Parameters:
        contextPath - JAXB context path to be used
        classloader - the class loader to be used to load JAXB
        outputFormat - the DOM4J OutputFormatto be used
        See Also:
        JAXBContext