[jdom-interest] JDOM JSR
jhunter at collab.net
Fri May 18 12:36:28 PDT 2001
Richard Baldwin wrote:
> For example, I would like to be able to iterate on the
> list returned by getMixedContent() and invoke
> getParent() on any item in that list without having to
> worry about the actual type of the object.
That can't be a serious use case. getParent() on every item would be
identical. What's a more realistic use case you've encountered?
Some background, covered before but I'll hit it again:
The problem is that the number of methods which JDOM objects have in
common or could have in common is close to zero. Therefore to create a
Node we have to either allow methods which don't make sense for all
objects (like getMixedContent() on Attribute) or we have Node as really
just a marker interface. Myself, I don't want to see non-sensical
methods because that's one of the core problems with DOM. And I don't
see sufficient value for Node as just a marker interface for reasons
Some people propose to get more methods into Node by restricting the set
of JDOM objects that would qualify as Nodes. That tends to come at the
cost of other people's desire for everything in JDOM to be a Node.
More information about the jdom-interest