[jdom-interest] RE: PROPOSAL: Remove most constructors from XMLOutputter

Rosen, Alex arosen at silverstream.com
Thu Oct 19 08:07:23 PDT 2000


> > It might be completely out-of-line, but would a Configuration
> > object be useful in this case?  Ever-expanding arguments
> > to a Constructor definitely isn't a Good Thing in my mind.

In addition to Alex's comments about config objects, I just want to put in a vote for a
very simple way to emit a human-readable (i.e. "pretty") version of a document. I don't
have a big problem with having one convenience constructor for this common case. But
maybe an even better solution would be static methods in XMLOutputter:

// Return a pretty-printed String version of the document.
public static String toString(Document d);

// Write a pretty-printed String version of the document to System.out.
public static void dump(Document d);

It's nice to make these common things really easy.

--Alex

P.S. Jason, I like the WellFormedChecker and ValidChecker ideas. Often if you're
constructing a document programmatically, you can know that the data you're adding is
well-formed and/or valid, without the extra checking.



More information about the jdom-interest mailing list