er.excel
Class EGSimpleTableParser
java.lang.Object
er.excel.EGSimpleTableParser
- public class EGSimpleTableParser
- extends Object
Parses an input stream for tables and converts them into excel
sheets. You must have a surrounding element as there is only one
root element in XML allowed.
Eg:<div><table 1><table 2>...</div>
You must take care that your content is XML readable.
Futhermore, 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.
A client would use this class like:
EGSimpleTableParser parser = new EGSimpleTableParser(new ByteArrayInputStream(someContentString));
NSData result = parser.data();
- Author:
- ak
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected final ERXLogger log
- logging support
EGSimpleTableParser
public EGSimpleTableParser(InputStream contentStream)
EGSimpleTableParser
public EGSimpleTableParser(InputStream contentStream,
NSDictionary fontDicts,
NSDictionary styleDicts)
writeToStream
public void writeToStream(OutputStream out)
throws IOException
- Throws:
IOException
data
public NSData data()
workbook
public HSSFWorkbook workbook()
Copyright © 2002 – 2004 Project Wonder.