Project Wonder 2.0

er.excel
Class EGSimpleTableParser

java.lang.Object
  extended byer.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

Field Summary
protected  ERXLogger log
          logging support
 
Constructor Summary
EGSimpleTableParser(InputStream contentStream)
           
EGSimpleTableParser(InputStream contentStream, NSDictionary fontDicts, NSDictionary styleDicts)
           
 
Method Summary
 NSData data()
           
 HSSFWorkbook workbook()
           
 void writeToStream(OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final ERXLogger log
logging support

Constructor Detail

EGSimpleTableParser

public EGSimpleTableParser(InputStream contentStream)

EGSimpleTableParser

public EGSimpleTableParser(InputStream contentStream,
                           NSDictionary fontDicts,
                           NSDictionary styleDicts)
Method Detail

writeToStream

public void writeToStream(OutputStream out)
                   throws IOException
Throws:
IOException

data

public NSData data()

workbook

public HSSFWorkbook workbook()

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.