Class XJdfPackager


public class XJdfPackager extends AbstractXmlPackager<XJDF>
Packaging logic for XJDF Documents. Package an XJDF with all references in a ZIP Package.
  • Constructor Details

    • XJdfPackager

      public XJdfPackager(OutputStream out)
      Create a new XJdfPackager.
      Parameters:
      out - The underlying OutputStream to write the package to.
    • XJdfPackager

      public XJdfPackager(Path zipPath, OutputStream out)
      Create a new XJdfPackager. This constructor should be used if an existing archive should be enhanced.
      Parameters:
      zipPath - The path to an existing archive.
      out - The underlying OutputStream to write the package to.
  • Method Details

    • packageXjdf

      public final void packageXjdf(XJDF xjdf) throws PackagerException
      Packages an XML Document to a zipped binary output stream.
      Parameters:
      xjdf - The XJDF document to package.
      Throws:
      PackagerException - If the XML document could not be packaged.
    • packageXjdf

      public final void packageXjdf(XJDF xjdf, String docName) throws PackagerException
      Packages an XML Document to a zipped binary output stream.
      Parameters:
      xjdf - The XJDF to package.
      docName - Document's name in the zipped package.
      Throws:
      PackagerException - If the XML document could not be packaged.
    • parseDocument

      protected final byte[] parseDocument(XJDF xjdf, boolean validation) throws Exception
      Description copied from class: AbstractXmlPackager
      Parses an XML document into a byte array.
      Specified by:
      parseDocument in class AbstractXmlPackager<XJDF>
      Parameters:
      xjdf - XML document to parse.
      validation - true, in case XML validation should be validated before packaging.
      Returns:
      Parsed document as byte array.
      Throws:
      Exception - If parsing fails.