[jdom-interest] XMLOutputter naming questions

Jason Hunter jhunter at collab.net
Sun Oct 1 12:41:35 PDT 2000


> - remove setIndenting() -- it's redundant with setIndent() and
> confusing to boot.  

It was modeled after the XMLC outputter, which had both.  I presume it's
because not everyone realizes that setIndent("") turns off indenting. 
It also allows you to temporarily turn it off with a flag, then restore
it to its original size, without recording the size.

>  Is anyone really in love with setIndenting(true)?  

Just trying to throw out possible uses.  I'm not in love with it.  :-)

> I'd like opinions on the following naming conventions:
> 
>         void output(Document d, OutputStream out)
>         void output(Element d, OutputStream out)
>         String output(Document d)
>         String output(Element e)

I don't like this.  I'd presume output(Element e) would write to the
default OutputStream, not return a string.

> versus:
> 
>         void output(Document d, OutputStream out)
>         void outputElement(Element d, OutputStream out)
>         String outputString(Document d)
>         String outputString(Element e)

Nah, outputElement might as well just be output.

> versus:
> 
>         void output(Document d, OutputStream out)
>         void output(Element d, OutputStream out)
>         String outputString(Document d)
>         String outputString(Element e)

This is fine.  But how about getString() instead of outputString()?

String doc = outputter.getString(d).

vs

String doc = outputter.outputString(d).

-jh-





More information about the jdom-interest mailing list