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

Brad Morgan Brad.Morgan at e-pubcorp.com
Wed Oct 18 09:31:24 PDT 2000


+1 from me.

Brad Morgan
e-Publishing Corp.

Email: Brad.Morgan at e-pubcorp.com
Phone: (719)593-7377 x35
Fax: (719)593-2996

e-Publishing Corp. is a BroadVision company
URL: http://www.e-pubcorp.com

-----Original Message-----
From: jdom-interest-admin at jdom.org
[mailto:jdom-interest-admin at jdom.org]On Behalf Of Alex Chaffee
Sent: Tuesday, October 17, 2000 4:51 PM
To: Brad Morgan
Cc: jdom-interest at jdom.org
Subject: [jdom-interest] PROPOSAL: Remove most constructors from
XMLOutputter (was round trip XML)


On Tue, Oct 17, 2000 at 10:08:19AM -0600, Brad Morgan wrote:
> I agree with you on the constructor issue.  I think adding the new
> ones is the upwardly compatible thing to do, but I'm acceptable to
> removing all but the default as well.  Either change produces a more
> consistant interface.  The current set of constructors seems lacking
> in consistancy given the ways in which people are tending to use
> them (pick a constructor that almost does what you want, then fine
> tune with methods).

I'd like to do this.  Can I have a straw poll on the following?

Remove all constructors from XMLOutputter except for the
following. Please vote separately if you want to, say, +1 the () but
-1 the (XMLOutputter)

1. XMLOutputter()
	preserve whitespace, don't add newlines or indents

2. XMLOutputter(XMLOutputter other)
	copy properties from other

3. XMLOutputter(boolean pretty)
	true: trim whitespace, add newlines and indents
	false: trim whitespace, don't add newlines or indents

Note that 2 is redundant with (XMLOutputter)other.clone(); I'm leaning
towards eliminating it too (even though I'm the one that wrote it :-)

Note also that 3's "false" is for the "compactest" output; I figure
that's a common enough use case that there should be a way to specify
it in the constructor.

Please see JavaDoc for the current confusing set of constructors, and
for all the properties you can set (proving it's unfeasible to set all
of them in the constructor):
http://www.jdom.org/docs/apidocs/org/jdom/output/XMLOutputter.html

 - Alex

--
Alex Chaffee                       mailto:alex at jguru.com
jGuru - Java News and FAQs         http://www.jguru.com/alex/
Creator of Gamelan                 http://www.gamelan.com/
Founder of Purple Technology       http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com




More information about the jdom-interest mailing list