[jdom-interest] Listeners
Phill_Perryman at Mitel.COM
Phill_Perryman at Mitel.COM
Tue Jul 6 07:16:34 PDT 2004
If the files are not huge you can use outputter to write the newly built
Document to a string. The save method then re-outputs the string and
compares the two. If they are the same don't save it.
/Phill
IS Dept, Software Engineer.
phill_perryman at mitel.com
http://www.mitel.com
Tel: +44 1291 436023
"Daniel Perry" <d.perry at netcase.co.uk>
Sent by: jdom-interest-admin at jdom.org
06/07/2004 14:06
To: <jdom-interest at jdom.org>
cc:
Subject: [jdom-interest] Listeners
I've been searching through the mailing lists for info on adding Listeners
to monitor changes in documents, etc.
So far i've figureed out that these listeners dont exist, and every
proposal/idea that i've come accross in the lists are concerned with
events
at the element level.
I am trying to work out how to do it at the document level.
I'm using jdom to work with config files and data files. In a current
project i need to save these files when they are changed. I would rather
somthing at a core level does this through a listener rather than call a
method after changing anything.
ie at the moment i am doing:
_someElement.setText("newValue");
// somehow get a reference to an xmlHandler class that is responsible for
this document, then...
xmlHandler.save();
I would rather do:
_someElement.setText("newValue");
and have the Document the element belongs to fire off an event through a
listener.
Does anyone have any suggestions on how i can do this?
As far as i can see, i would have to extend element and add a reference to
it's document. I would have to also override any methods that change
content to fire off an event through the document. I would have to extend
document to add the listener methods. I would then have extend saxbuilder
and make it use these new types.
Is there an easier way to do this?
Thanks,
Daniel.
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20040706/bf46a73a/attachment.htm
More information about the jdom-interest
mailing list