[jdom-interest] How to ease traversal of JDOM tree

Sébastien Pierre spierre at isb-sib.ch
Mon Nov 19 09:20:21 PST 2001


Le lundi 19 novembre 2001, à 05:52 PM, Laurent Bihanic a écrit :
>
> The idea is to have a small interface all JDOM classes representing
> XML data (Document, Element, Attribute, Comment, Text..., except
> Namespace) would implement.
>
> This interface (let's call it Node) would only define the following
> methods:(...)
>

(...)

> Opinions?

I really agree with that, and was actually thinking it was one of the 
problems with JDOM. I would definitely appreciate a common interface, I 
have a JDOM wrapper that maps JDOM objects to Swing Document objects and 
I have implemented a common interface for the Wrapper, because I was 
also tired of instanceof tests.

But I don't understand why this would change the JDOM API? I think we 
shouldn't modify method return types or behaviour, but there is no 
problem in my opinion for adding some methods that implement a Node 
interface.

Cheers,

  -- Sébastien.




More information about the jdom-interest mailing list