[jdom-interest] XMLOutputter observations
richard.beton at dsl.pipex.com
Thu Feb 26 14:28:11 PST 2004
I'm new on the list so forgive me if this repeats things others have
I wanted to write some XHTML and SVG documents from Java, so I started
writing an XMLWriter class to ensure the syntax is well-formed and
valid. Then I thought I'd check out other possibilities before I'd gone
too far on a home grown solution. JDOM offers what appears (in my
limited knowledge) to be a well-matched solution to what I need.
So I downloaded the source code via CVS and started looking through to
see what it could do for me. Here are a few first-impression
detail-code-review type of observations, which may be useful or not. (I
don't claim to have done any sort of thorough code review, just a first
glance. Generally, it appears a lot of care has gone into the coding,
which inspires a good level of confidence.).
Re: org.jdom.output.XMLOutputter rev 1.105
1. lines 59...: imports with * should be expanded (to eliminate
2. skipTrialingWhite (line 1220) - spelling should be skipTrailingWhite
- this method is private so it's not very important
3. outputString (lines 524...) - these methods are perhaps in the wrong
class. Although a clever convenience, they rather fatten the class with
something that could have been separate (e.g. as a helper class or a
4. I am uneasy that the output(Document doc, OutputStream out) method,
which writes a whole document in one go, sits alongside a suite of other
output methods that write a document part by part. These seem to me to
be different ways of doing the same thing; perhaps therefore they should
be done by different classes (?).
5. Eclipse points out some other redundant imports:
XMLOutputter only needs
DefaultJDOMFactory: only needs
JDOMFactory: only needs
ElementFilter only needs:
That's enough for now. Enjoy!
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3455 bytes
Desc: S/MIME Cryptographic Signature
Url : http://jdom.org/pipermail/jdom-interest/attachments/20040226/d93f9704/smime.bin
More information about the jdom-interest