[jdom-commits] CVS Update: jdom/src/java/org/jdom/output
nobody
nobody at chimbo.servlets.com
Thu May 1 20:34:41 PDT 2003
****************************************
Date: Thu May 1, 2003 @21:34:41 MDT
Author:
Update of /home/cvs/jdom/src/java/org/jdom/output
In directory chimbo:/tmp/cvs-serv27619/output
Modified Files:
XMLOutputter.java
Added Files:
Format.java
Log Message:
Major change to XMLOutputter.
XMLOutputter now uses a brand new external "Format" class to store its
format state. Format has convenience methods .getRawFormat(),
.getPrettyFormat(), and .getCompactFormat() in lieu of people having to
remember when to trim, set indents, and such. I've deprecated the various
XMLOutputter.set*() methods and moved them into Format itself. I've also
deprecated the constructors that took indents and so on.
Now instead of this:
new XMLOutputter(" ", true);
You'll do something like this:
new XMLOutputter(Format.getPrettyFormat());
I also changed the set*() method to chain so power users can do this:
new XMLOutputter(Format.getRawFormat().setOmitEncoding(true));
or
new XMLOutputter(Format.getPrettyFormat().setIndent("t"));
Of course non-power users can just do this:
Format f = new Format();
f.setOmitEncoding(true);
XMLOutputter outp = new XMLOutputter(f);
I also moved the new EscapeStrategy logic and DefaultEscapeStrategy inner
class into Format.
I didn't give the Format class "getter" methods for the properties. If
there's a reason someone would want one, let me know.
This is based in part on jdom-x from Brad.
-jh-
===================================================================
File: no file Format.java Status: Needs Checkout
Working revision: 1.1 Fri May 2 03:34:41 2003
Repository revision: 1.1 /home/cvs/jdom/src/java/org/jdom/output/Format.java,v
Existing Tags:
No Tags Exist
===================================================================
File: no file XMLOutputter.java Status: Needs Checkout
Working revision: 1.96 Fri May 2 03:34:41 2003
Repository revision: 1.96 /home/cvs/jdom/src/java/org/jdom/output/XMLOutputter.java,v
Existing Tags:
jdom_1_0_b9 (revision: 1.91)
jdom_1_0_b8 (revision: 1.76)
jdom_prefilter (revision: 1.66)
jdom_1_0_b7 (revision: 1.62)
jdom_1_0_b6 (revision: 1.35)
start (revision: 1.1.1.1)
jdom (branch: 1.1.1)
More information about the jdom-commits
mailing list