[jdom-interest] Adding a DocumentListener interface

Harry Evans hevans at elite.com
Mon Jul 24 15:15:03 PDT 2000


I think that the most likely place for generating a JDOM tree with wrapper
sub classes for some or all of the core 
objects would be in a subclass of the SaxBuilder or the DomBuilder.  It
should not be too difficult to hack either of these in a sub class or
separate work-alike class to generate the specific sub element types you
need, especially if the sub elements contain the same basic data, and you
are only trying to add listeners.  That, at least, is where I would start.
While this would work, you are going to have to cast the returned Elements,
Attributes, etc, to your specific sub types in order to add the listeners,
unless you do the listener registration at build time.

If you are constructing documents from scratch, instead of parsing, the
solution is even easier.  If you create sub classes of the data types you
need listeners for, but only add methods, without overriding the existing
methods, the current outputters should output your stuff without any
additional efforts whatsoever.

Hope this helps.

Harry Evans

-----Original Message-----
From: Steve Weiss [mailto:sweiss at aamc.org]
Sent: Monday, July 24, 2000 2:50 PM
To: jdom-interest at jdom.org
Subject: Re: [jdom-interest] Adding a DocumentListener interface


I would agree with this, my application will also need this
functionality but I haven't gotten there yet. Maybe this is a candidate
for jdom-contrib?

-S

Steve Meister wrote:
> 
> I have a need for this functionality too, but only when users are
> interactively creating and modifying documents. The rest of the time when
> I'm parsing and processing XML documents, these features are unnecessary.
My
> approach and recommendation is to write a set of wrapper classes. The GUI
> works with XML documents using the wrapper classes as proxies for the JDOM
> classes, and the rest of the system uses the lightweight, efficient JDOM
> classes themselves.
> 
> Keep JDOM simple, don't add a feature that's only going to be of benefit
to
> a subset of applications.
> 
> -----Original Message-----
> From: Jason Hunter [mailto:jhunter at acm.org]
> Sent: Monday, July 24, 2000 3:58 PM
> To: kash at sideshowbobproject.com
> Cc: jdom-interest at jdom.org
> Subject: Re: [jdom-interest] Adding a DocumentListener interface
> 
> > I would like to have a DocumentListener interface so that the
> > parts of my app can be notified.
> >
> > ...
> >
> > 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.
> 
> Before we would add something like that (which does have a cost in API
> complexity, execution speed, and memory consumption) we'd need a
> compelling and common use case for what someone would do with the
> functionality that can't be solved elegantly using the existing feature
> set.  Can you provide that?
> 
> -jh-
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
> t.com
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com

-- 
Steve Weiss      Association of American Medical Colleges
(202)828-0428    mailto:sweiss at aamc.org    http://www.aamc.org
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com



More information about the jdom-interest mailing list