
Public Member Functions | |
| NSData | data () |
| EGSimpleTableParser (InputStream contentStream, NSDictionary fontDicts, NSDictionary styleDicts) | |
| EGSimpleTableParser (InputStream contentStream) | |
| HSSFWorkbook | workbook () |
| void | writeToStream (OutputStream out) throws IOException |
Protected Attributes | |
| final Logger | log = Logger.getLogger(EGSimpleTableParser.class) |
Private Member Functions | |
| void | addEntriesFromNode (NSMutableDictionary dictionary, Node node) |
| String | attributeStringToKeyPath (String aString) |
| String | dictValueForKey (NSDictionary dict, String key, String defaultValue) |
| HSSFFont | fontWithID (String id) |
| String | keyPathToAttributeString (String aString) |
| String | nodeValueForKey (Node node, String key, String defaultValue) |
| void | parse () |
| void | parseFont (Node node) |
| void | parseNode (Node node) |
| void | parseStyle (Node node) |
| void | parseTable (Node tableNode) |
| HSSFCellStyle | styleWithDictionary (NSDictionary dict) |
| void | takeBooleanValueForKey (NSDictionary dict, String key, Object target, String defaultValue) |
| void | takeClassValueForKey (NSDictionary dict, String key, Object target, Class source, String defaultValue) |
| void | takeClassValueForKey (NSDictionary dict, String key, Object target, String defaultValue) |
| void | takeNumberValueForKey (NSDictionary dict, String key, Object target, String defaultValue) |
Private Attributes | |
| InputStream | _contentStream |
| NSMutableDictionary | _fontDicts |
| NSMutableDictionary | _fonts = new NSMutableDictionary() |
| NSMutableDictionary | _styleDicts |
| NSMutableDictionary | _styles = new NSMutableDictionary() |
| HSSFWorkbook | _workbook |
Static Private Attributes | |
| static final NSArray | STYLE_KEYS |
<div><table 1><table 2>...</div> You <emp>must</emp> 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 <emp>must</emp> 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. 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 thouroughly tested.
A client would use this class like:
EGSimpleTableParser parser = new EGSimpleTableParser(new ByteArrayInputStream(someContentString));
NSData result = parser.data();
| EGSimpleTableParser | ( | InputStream | contentStream | ) |
| EGSimpleTableParser | ( | InputStream | contentStream, | |
| NSDictionary | fontDicts, | |||
| NSDictionary | styleDicts | |||
| ) |
| void addEntriesFromNode | ( | NSMutableDictionary | dictionary, | |
| Node | node | |||
| ) | [private] |
| fontDictionary | ||
| tableNode |
| NSData data | ( | ) |
| HSSFFont fontWithID | ( | String | id | ) | [private] |
| void parse | ( | ) | [private] |
| void parseFont | ( | Node | node | ) | [private] |
| void parseNode | ( | Node | node | ) | [private] |
| void parseStyle | ( | Node | node | ) | [private] |
| void parseTable | ( | Node | tableNode | ) | [private] |
| HSSFCellStyle styleWithDictionary | ( | NSDictionary | dict | ) | [private] |
| void takeBooleanValueForKey | ( | NSDictionary | dict, | |
| String | key, | |||
| Object | target, | |||
| String | defaultValue | |||
| ) | [private] |
| void takeClassValueForKey | ( | NSDictionary | dict, | |
| String | key, | |||
| Object | target, | |||
| Class | source, | |||
| String | defaultValue | |||
| ) | [private] |
| void takeClassValueForKey | ( | NSDictionary | dict, | |
| String | key, | |||
| Object | target, | |||
| String | defaultValue | |||
| ) | [private] |
| void takeNumberValueForKey | ( | NSDictionary | dict, | |
| String | key, | |||
| Object | target, | |||
| String | defaultValue | |||
| ) | [private] |
| HSSFWorkbook workbook | ( | ) |
| void writeToStream | ( | OutputStream | out | ) | throws IOException |
InputStream _contentStream [private] |
NSMutableDictionary _fontDicts [private] |
NSMutableDictionary _fonts = new NSMutableDictionary() [private] |
NSMutableDictionary _styleDicts [private] |
NSMutableDictionary _styles = new NSMutableDictionary() [private] |
HSSFWorkbook _workbook [private] |
final Logger log = Logger.getLogger(EGSimpleTableParser.class) [protected] |
logging support
final NSArray STYLE_KEYS [static, private] |
Initial value:
new NSArray(new Object[] { "font","hidden","locked","wrapText", "leftBorderColor","rightBorderColor","topBorderColor","bottomBorderColor", "borderLeft","borderRight","borderTop","borderBottom", "fillForegroundColor","fillBackgroundColor","fillPattern", "rotation","indention", "wrapText", "alignment","verticalAlignment","format" })
1.5.8