Package ch.rabanti.picoxlsx4j.lowLevel
Class LowLevel
- java.lang.Object
-
- ch.rabanti.picoxlsx4j.lowLevel.LowLevel
-
public class LowLevel extends 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.- Author:
- Raphael Stoeckli
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static byte[]
createBytesFromDocument(Document document)
Method to convert an XML document to a byte arrayDocument
createXMLDocument(String rawInput, String title)
Creates a XML document from a stringboolean
getDocumentInterception()
Gets whether XML documents are intercepted during creationHashMap<String,Document>
getInterceptedDocuments()
Gets the intercepted documents if interceptDocuments is set to truevoid
save()
Method to save the workbookvoid
saveAsStream(OutputStream stream)
void
setDocumentInterception(boolean interceptDocuments)
Set whether XML documents are intercepted during creation
-
-
-
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 HashMap<String,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 Document createXMLDocument(String rawInput, String title) throws IOException
Creates a XML document from a string- Parameters:
rawInput
- String to processtitle
- 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(OutputStream stream) throws IOException
- Throws:
IOException
-
createBytesFromDocument
public static byte[] createBytesFromDocument(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
-
-