[jdom-interest] Legal values of line separator

Alex Chaffee guru at edamame.stinky.com
Mon Jul 10 11:54:49 PDT 2000


> While I like Alex's suggestions for the names of the named constants, 
> I'd rather not add them if we're going to allow any string as a line 
> break. They're a minor convenience at most, and they add several more 
> public fields to the API.

-0 on removing SEPARATOR_* 

(i like the constants -- what if I forget what wacky character Macs
use? -- but won't quibble)

-1 on removing SEPARATOR_LOCAL 

(i like the getProperty("line.separator") to be in the library code)


> For similar reasons, if we're going to do line separators this way, I 
> think we should get rid of the boolean newlines field. Instead, this 
> functionality should be replaced by setting the line separator string 
> to null or the empty string. For example, the constructor
> 
> public XMLOutputter(java.lang.String indent,
>                      boolean newlines,
>                      java.lang.String encoding)
> 
> would become
> 
> public XMLOutputter(java.lang.String indent,
>                      String lineSeparator,
>                      java.lang.String encoding)
> 
> 
> and then we don't have to throw an exception on a null line separator either.

+1

-- 
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/



More information about the jdom-interest mailing list