Java Mailing List Archive

Home » Home (12/2007) » JDOM User »

[jdom-interest] output package - XMLOutputter API question

Rick Beton



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.


To control your jdom-interest membership:
©2008 - Jax Systems, LLC, U.S.A.