public class EGSimpleTableParser extends Object
Eg:<div><table 1><table 2>...</div>
You must take care that your content is XML readable.
There is support for a CSS-like style tagging. Either supply
font and style dictionaries in the constructor or via <style> and <font> tags.
The tags are shown in the example, but mainly the attributes are named the same as the properties
of the HSSFCellStyle
and HSSFFont
objects. The symbolic names from theses classes (eg. HorizontalAlignment.RIGHT
) are also supported.
In addition, the tags must have an id
attribute and can specify an
extends
attribute that contains the ID of the style that is extended - all properties from this
style and it's predecessors are copied to the current style.
In addition, you can specify an attribute in any <table>, <tr>, <th> and <td> tag.
When this happens a new style is created and it applies to the contents of this tag.
The value is copied as text from the cell's content, so you better take care that it is parsable
and matches the cellStyle
and cellFormat
definition.
The parser also supports the some-name
attribute names in addition to
someName
as using the Reformat command in WOBuilder messes up the case
of the tags. When used in .wod files, the attributes must be enclosed in quotes
("cell-type"=foo;
). Some care must be taken when the attributes in the current node override the ones
from the parent as this is not thoroughly tested.
A client would use this class like:
EGSimpleTableParser parser = new EGSimpleTableParser(new ByteArrayInputStream(someContentString));
NSData result = parser.data();
Constructor and Description |
---|
EGSimpleTableParser(InputStream contentStream) |
EGSimpleTableParser(InputStream contentStream,
NSDictionary fontDicts,
NSDictionary styleDicts) |
Modifier and Type | Method and Description |
---|---|
protected org.apache.poi.ss.usermodel.RichTextString |
createRichTextString(Object value) |
protected org.apache.poi.ss.usermodel.Workbook |
createWorkbook() |
com.webobjects.foundation.NSData |
data() |
org.apache.poi.ss.usermodel.Workbook |
workbook() |
void |
writeToStream(OutputStream out) |
public EGSimpleTableParser(InputStream contentStream)
public EGSimpleTableParser(InputStream contentStream, NSDictionary fontDicts, NSDictionary styleDicts)
public void writeToStream(OutputStream out) throws IOException
IOException
public com.webobjects.foundation.NSData data()
public org.apache.poi.ss.usermodel.Workbook workbook()
protected org.apache.poi.ss.usermodel.Workbook createWorkbook()
protected org.apache.poi.ss.usermodel.RichTextString createRichTextString(Object value)
Copyright © 2002 – 2020 Project Wonder.