I'm leaving today for Santa Clara and the Software Development 2004 West Conference. I'll have intermittent Internet access at the show, but I'll be quite busy so updates may be sporadic until I return next week.
With a great deal of effort, I've managed to push out one more release of XOM, my tree-based streaming API for processing XML with Java, before I leave. I had hoped that this would be alpha 1 and I could declare the API frozen. However, a few too many good ideas were submitted at the last minute to ignore, so I thought I'd make one more development release to shake out any bugs in the new classes and methods. So herewith is XOM 1.0d25. Anything that didn't change since the last release is probably not going to change now. However, there are some new features in this release that are worth reviewing and are not necessarily stable:
All 21 protected checkFoo
methods have been removed.
Instead the various mutator methods (setters and other methods that change the
state of an object) are now non-final so they can be overridden.
The getter methods are stil final and the fields are all private.
Thus to change the state of an object setter methods
still need to call the
constraint-verifying superclass methods.
This should give subclasses a lot more flexibility while not
compromising on well-formedness. (I'm not sure why I didn't think of this a year and a half ago. I suspect I was too focused on the way JDOM did things, and incorrectly assuming that the only way to make
setters non-final was to expose the fields as well. Clearly that's not true, but sometimes when you get a wrong idea in your head, it's really hard to shake it. It took an offhand remark from John Cowan about JavaDoc comments to make me realize that I didn't really
need to expose the fields just because the methods that wrote to them were overrridable.)
The Serializer
now throws UnavailableCharacterException
,
a subclass of XMLException
, instead of a raw XMLException
when it encounters a character it can neither write nor escape in the current encoding.
NodeFactory.makeDocument
has been renamed startMakingDocument
.
NodeFactory.endDocument
has been renamed finishMakingDocument
.
DOMConverter
can convert a DocumentFragment
to a Nodes
.
Added an XSLTransform.toDocument()
method that converts a Nodes
to
a Document
.
Element.removeChildren()
now returns a Nodes
object containing the children removed.
The LeafNode
class has been removed. DocType
, Text
, Comment
, and ProcessingInstrcution
now directly extend Node
.
Removed the hasChildren
method from Element
, Node
, ParentNode
, Attribute
and Document
.
Element.addAttribute
is declared to throw the more specific MultipleParentException
instead of
IllegalAddException