From 4dab9c6850b0846ee396190da1f4d9e2f325b4c1 Mon Sep 17 00:00:00 2001 From: Glen Stampoultzis Date: Sat, 9 Mar 2002 01:41:01 +0000 Subject: [PATCH] Documented (a bit) the record generator. git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352161 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/xdocs/hssf/book.xml | 1 + .../xdocs/hssf/record-generator.xml | 98 +++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 src/documentation/xdocs/hssf/record-generator.xml diff --git a/src/documentation/xdocs/hssf/book.xml b/src/documentation/xdocs/hssf/book.xml index be8d03b21..d3f5fd478 100644 --- a/src/documentation/xdocs/hssf/book.xml +++ b/src/documentation/xdocs/hssf/book.xml @@ -12,6 +12,7 @@ + \ No newline at end of file diff --git a/src/documentation/xdocs/hssf/record-generator.xml b/src/documentation/xdocs/hssf/record-generator.xml new file mode 100644 index 000000000..2b2aba6a1 --- /dev/null +++ b/src/documentation/xdocs/hssf/record-generator.xml @@ -0,0 +1,98 @@ + + + + +
+ Record Generator HOWTO + + + +
+ + + + +

+ The record generator was born from my frustration with translating + the Excel records to Java classes. Doing this manually is a time + consuming process. It's also very easy to make mistakes. +

+

+ I wanted something that would take the defintition of what a + record looked like and do all the boring stuff for me. Thus the + record generator was born. +

+
+ + +

+ The record generator takes XML as input and produced the following + output: +

    +
  • A java file capabile of decoding and encoding the record.
  • +
  • A test class with provides a fill-in-the-blanks implementation of a test case + for ensuring the record operates as designed.
  • +
+

+
+ +

+ The record generator is invoked as an Ant target (generate-records). It goes + through looking for all files in src/records/defintitions ending with _record.xml. + It then creates two files; the Java record definition and the Java test case template. +

+

+ The records themselves have the following general layout: +

+ + The frame record indicates whether there is a border around the displayed text of a chart. + Glen Stampoultzis (glens at apache.org) + + + + + + + + + + + + ]]> +

+ The Java records are regenerated each time the record generator is run, however the test stubs are + only created if the test stub does not already exist. What this means is that you may change + test stubs but not the generated records. +

+
+ +

+ TODO: Fill this out more +

+

+ See record.xsl, record_test.xsl, FieldIterator.java, RecordUtil.java, RecordGenerator.java +

+

+

+
+ +

+ The record generator does not handle all possible record types and is not ment to. Sometimes it's + going to make more sense to generate the records manually. The main point of this thing is to + make the easy stuff simple. +

+

+ Currently the record generator is optimized to create Excel records. It could be adapted to create + Word records with a little poking around. +

+

+ Currently the the XSL file that generates the record calls out to java objects. This would have been + better done as Javascript inside the XSL file itself. The java code for the record generation is + currently quite messy with minimal comments. Sorry, I wrote it as a proof-of-concept and just went + too far. +

+
+
+ +