[jdom-interest] Adding a DocumentListener interface

michael salmon geek at papermedia.com
Mon Jul 24 14:19:11 PDT 2000

in a case like this it would be good to have something like a writable SAX,
but of course SAX simply doesnt edit xml inline, you can use it to transform
data.  If you are actually in need of the document to send events internally a
file on disk will have obvious problems doing that. 
Basically If you need something like this id recommend looking into stored
database procedures and storing Document and NodeList objects inside it.
Adding an ability like this in jdom sounds good but i'd guess it would run into
file locking problems,  to have the listeners work you'd need to keep the
Document persistant across transaction, and having shared resources like this
floating in memory can be dangerous and memory intensive for massive projects.
Of course i could be way off mark here, maybe you can give a better description
of what your looking to do?

 On Mon, 24 Jul 2000, kash at sideshowbobproject.com
wrote: > Hi, >  I'm writing an application and JDOM looks great for my
purposes, but I need to know > when changes are made to the document or the
elements.  I would like to have a > DocumentListener interface so that the
parts of my app can be notified.  As it is, > it looks like I'll have to write
wrapper classes for the elements and for JDOM to > take care of this
notification. >  > I need methods like: > 
> //an integral part of the document has changed...
> //all listeners should do a complete update.
> public void jdomChanged();
> //the element has changed: children were replaced, added etc.
> public void elementChanged(Element e);
> //e's attributes have been modified in some way.
> public void attributeChanged(Element e);
> and of course, the JDOM class needs methods to add and remove listeners.
> I'm willing to submit a patch for this, but before I do any coding, I want to know
> if there is a better way (or currently implemented way) to do this.
> Thanks,
> Ken Ashcraft
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

More information about the jdom-interest mailing list