As you may have seen in the CVS messages I have moved most of the setup
code that was in the render() method to the getContentHandler() method.
This is necessary because not everyone uses the render() methods,
sometimes you simply need to have a ContentHandler to send SAX events to.
Some of our examples (and some of our basic test cases) use that
approach.

What is left to do is to enable the FOTreeListener for Document that is
currently added only if the render() method is called. Providing the
same functionality with getContentHandler() only means you're not in the
Driver class anymore when endDocument() is called on the ContentHandler
which makes it difficult to remove the FOTreeListener on the
FOTreeHandler when processing is complete.

If noone objects, if noone has a better idea and if noone fixes that
ahead of me, I'm going to write a ProxyingDefaultHandler as a utility
class that does nothing other than pass through all method calls to
another DefaultHandler (in other words: the FOTreeBuilder). I'll then
add an anonymous inner class derived from that ProxyingDefaultHandler in
getContentHandler that listens to the endDocument() event and calls
removeFOTreeListener on FOTreeHandler. Instead of the FOTreeBuilder that
anonymous inner class will be returned by getContentHandler().

Jeremias Maerki

Reply via email to