public class EGSimpleTableParser
extends java.lang.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. ALIGN_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();
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.log4j.Logger |
log
logging support
|
| Constructor and Description |
|---|
EGSimpleTableParser(java.io.InputStream contentStream) |
EGSimpleTableParser(java.io.InputStream contentStream,
NSDictionary fontDicts,
NSDictionary styleDicts) |
| Modifier and Type | Method and Description |
|---|---|
NSData |
data() |
org.apache.poi.hssf.usermodel.HSSFWorkbook |
workbook() |
void |
writeToStream(java.io.OutputStream out) |
public EGSimpleTableParser(java.io.InputStream contentStream)
public EGSimpleTableParser(java.io.InputStream contentStream,
NSDictionary fontDicts,
NSDictionary styleDicts)
public void writeToStream(java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic NSData data()
public org.apache.poi.hssf.usermodel.HSSFWorkbook workbook()
Copyright © 2002 – 2022 Project Wonder.