[jdom-interest] output package - XMLOutputter API question

Rick Beton richard.beton at dsl.pipex.com
Thu Jul 20 11:41:51 PDT 2006

Hi all,

Mostly JDOM works extremely well for me and I am grateful to those who 
developed it.  Occasionally a question crops up - here goes...

In the API for XMLOutputter,
the output(...) methods and outputString(...) methods use overloading to 
cater for all the various subclasses of Content (Comment, DocType, 
Element, EntityRef, ProcessingInstruction, and Text). There are 
similarly overloaded methods to handle Document and List.

Wouldn't it be simpler just to have one output(Content, Writer) and one 
outputString(Content) method instead?
(plus of course the overloaded methods that take a Document and a List)

The implementation of this single method would be similar to that of the 
method that takes a List, i.e. it would have to test using instanceof 
and call the appropriate printCDATA / printComment / ... methods.


More information about the jdom-interest mailing list