[jdom-interest] PROPOSAL: Remove most constructors from XMLOu tputter (was round trip XML)

philip.nelson at omniresources.com philip.nelson at omniresources.com
Wed Oct 18 08:51:36 PDT 2000

> > I'd like to do this.  Can I have a straw poll on the following?
> 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.
> Calling setFoo() or makeFoo() 4 times after constructing
> an object gets annoying also, if you do it repeatedly.
> Howsabout:
> 	XMLOutConfiguration config = new XMLOutConfiguration();
> 	config.useNewlines("true");
> 	....
> 	config.stripWhitespace("true");
> 	XMLOutputter out = new XMLOutputter(config);
> Allow folks to re-use the XMLOutConfiguration, and possibly
> initialize it from a Properties or InputStream or even
> a Document. 

I think this is a great idea.  Within a given application, you may use an
XMLOutputter many times with the identical configuration and all those
setters will annoy me.  Trying to anticipate the common uses with static
strings as constructor arguments seems like a hopeless effort.

Correct me if I'm wrong about this, but isn't having tremendous flexibility
in how the xml is output doing what we could/should/would do with XSLT if it
wasn't such an expensive, "out of the box" task with JDOM?  I realize this
is not the case with encodings but with all the indenting, whitespace issues
it seems to me that XMLOutputter is getting a lot more complicated that it
was intended to be.

> Just pondering flexibility without increasing the API
> every time something new pops up.
> 	-bob
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yo
uraddr at yourhost.com

More information about the jdom-interest mailing list