Class LowLevel


  • public class LowLevel
    extends java.lang.Object
    Class for low level handling (XML, formatting, preparing of packing)
    This class is only for internal use. Use the high level API (e.g. class Workbook) to manipulate data and create Excel files.
    • Constructor Summary

      Constructors 
      Constructor Description
      LowLevel​(Workbook workbook)
      Constructor with defined workbook object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] createBytesFromDocument​(org.w3c.dom.Document document)
      Method to convert an XML document to a byte array
      org.w3c.dom.Document createXMLDocument​(java.lang.String rawInput, java.lang.String title)
      Creates a XML document from a string
      boolean getDocumentInterception()
      Gets whether XML documents are intercepted during creation
      java.util.HashMap<java.lang.String,​org.w3c.dom.Document> getInterceptedDocuments()
      Gets the intercepted documents if interceptDocuments is set to true
      void save()
      Method to save the workbook
      void saveAsStream​(java.io.OutputStream stream)  
      void setDocumentInterception​(boolean interceptDocuments)
      Set whether XML documents are intercepted during creation
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LowLevel

        public LowLevel​(Workbook workbook)
        Constructor with defined workbook object
        Parameters:
        workbook - Workbook to process
    • Method Detail

      • getDocumentInterception

        public boolean getDocumentInterception()
        Gets whether XML documents are intercepted during creation
        Returns:
        If true, documents will be intercepted and stored into interceptedDocuments
      • setDocumentInterception

        public void setDocumentInterception​(boolean interceptDocuments)
        Set whether XML documents are intercepted during creation
        Parameters:
        interceptDocuments - If true, documents will be intercepted and stored into interceptedDocuments
      • getInterceptedDocuments

        public java.util.HashMap<java.lang.String,​org.w3c.dom.Document> getInterceptedDocuments()
        Gets the intercepted documents if interceptDocuments is set to true
        Returns:
        HashMap with a String as key and a XML document as value
      • createXMLDocument

        public org.w3c.dom.Document createXMLDocument​(java.lang.String rawInput,
                                                      java.lang.String title)
                                               throws IOException
        Creates a XML document from a string
        Parameters:
        rawInput - String to process
        title - Title for interception / debugging purpose
        Returns:
        Formatted XML document
        Throws:
        IOException - Thrown in case of an error while creating the XML document
      • save

        public void save()
                  throws IOException
        Method to save the workbook
        Throws:
        IOException - Thrown in case of an error
      • saveAsStream

        public void saveAsStream​(java.io.OutputStream stream)
                          throws IOException
        Throws:
        IOException
      • createBytesFromDocument

        public static byte[] createBytesFromDocument​(org.w3c.dom.Document document)
                                              throws IOException
        Method to convert an XML document to a byte array
        Parameters:
        document - Document to process
        Returns:
        array of bytes (UTF-8)
        Throws:
        IOException - Thrown if the document could not be converted to a byte array