[jdom-commits] CVS update: jdom/src/java/org/jdom/output

jhunter at cvs.jdom.org jhunter at cvs.jdom.org
Wed Mar 21 22:34:36 PST 2001

Date:	Thursday March 22, 2001 @ 6:34
Author:	jhunter

Update of /home/cvspublic/jdom/src/java/org/jdom/output
In directory www.nmemonix.com:/tmp/cvs-serv23512/output

Modified Files:
Log Message:
Major internal changes to XMLOutputter, and some public and protected 
method signature changes.

The code is now much cleaner with regard to whitespace handling, and the
"text trim" printing behaves a whole lot better.  In fact, the following
settings now pretty print on output even if the doc contains some content
with whitespace from a file and some content built in memory with no

setIndent("  ");

It may not perfectly match everyone's idea of "pretty" but in my mind
it's "pretty" good.  :-)

BTW, the default settings (no trim, no indent, no newlines) still 
behave the exact same as before and print the document raw.

Among the structural changes: The printXXX() methods now only print
XXX and don't concern themselves with whitespace around the XXX item.
For example, printComment() prints only the comment from <!-- to --> and 
doesn't try to print the new lines and indention before and after.  
The only place where whitespace handling occurs is printDocument() 
for document-level whitespace and printElementContent() for the whitespace 
between an element's tags.  But in both these cases the whitespace is 
naturally within the item being printed.

The signature changes:

* Deprecated "public setIndentLevel()" method.  Having a global indent is 
  better done with a stacked FilterOutputStream.  The method is now empty.
  It'll be removed after beta7.
* Deprected "public setPadText()" method.  It's not needed with the 
  current output mechanism.  The method is now empty.  It'll be removed 
  after beta7.
* Changed the "protected printXXX()" methods to have a new signature 
  without the "int indentLevel" final parameter.  Didn't bother with
  deprecation here.

Thanks to Mark Roder <mroder at techies.com> for raising the issue that got 
this started.


File: no file XMLOutputter.java		Status: Needs Checkout

   Working revision:	1.40	Thu Mar 22 06:34:35 2001
   Repository revision:	1.40	/home/cvspublic/jdom/src/java/org/jdom/output/XMLOutputter.java,v

   Existing Tags:
	start                    	(revision:
	jdom                     	(branch: 1.1.1)

More information about the jdom-commits mailing list