Java Mailing List Archive

http://www.junlu.com/

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

[jdom-interest] output package - XMLOutputter API question

Rick Beton

2006-07-20

Replies:

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,
  http://jdom.org/docs/apidocs/org/jdom/output/XMLOutputter.html
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.

Regards,
Rick



_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.