output package - XMLOutputter API question 2006-07-20 - By Rick Beton
Back 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)
|
|