[jdom-interest] Events for JDOM
Paul Libbrecht
paul at ags.uni-sb.de
Mon Nov 19 08:24:40 PST 2001
On Lundi, novembre 19, 2001, at 09:36 AM, Sébastien Pierre wrote:
> I was also looking for a similar feature and found two possibilities:
>
> - Re-implement parts of the Element class. This has the advantage that
> you can optimize access to elements (in my case this means optimizing
> iteration on element content and direct modification of the lists instead
> of a setContent). You can also choose what you want to monitor and how.
Do you mean simply ensure that the getContent() method returns you a real
list where the listIterator can delete and replace ??
I've been assuming this (changing the source appropriately) as this should
come with the newer FilterList.
> - Make a wrapper around the elements you want to monitor, in this case
> you can leave the JDom classes as is- the advantage is that if the
> wrapper is well done it can be used by others without having to be merged
> into the JDOM API.
Well... I'm currently trying to perform the implementation of these
"Recipes"-like event. I have almost a kind of interface.
The most difficult bit that I foresee is in the definition of positionning:
the ability to declare, for example, that you want to remove "this child"
of this element is pretty limited.
In particular, in order to perform this removal, you need to go to the
parent, iterate through the content and remove the element then.
Having something like a number for the position of an element stored in
the element as well might ease up quite many things but I fear this is
out of the simplicity of JDOM.
Paul
More information about the jdom-interest
mailing list