[jdom-interest] Adding a DocumentListener interface

kash at sideshowbobproject.com kash at sideshowbobproject.com
Mon Jul 24 12:23:40 PDT 2000

	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.

Ken Ashcraft

More information about the jdom-interest mailing list