[jdom-interest] Adding a DocumentListener interface

tsasala at hifusion.com tsasala at hifusion.com
Tue Jul 25 06:51:02 PDT 2000


	Is it possible to use the observer/observable interface/methods in 
the java language?

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