[jdom-interest] Extending JDOM classes
Haruki_Zaemon at hotmail.com
Sun Aug 13 17:13:44 PDT 2000
Excellent Thanks. I can't really come up with a "better" solution given my
requirements. So I'll go with this solution for the short term.
All in all I think JDOM is great. sure beats the hell out of using the DOM!
P.S. Did you noticed my question regarding access to data type information
from the schema.
----- Original Message -----
From: "Jason Hunter" <jhunter at acm.org>
To: "Simon Harris" <Haruki_Zaemon at hotmail.com>
Cc: "JDOM Interest" <jdom-interest at jdom.org>
Sent: Monday, August 14, 2000 9:58 AM
Subject: Re: [jdom-interest] Extending JDOM classes
> The standard approach to this is to have your builder build
> Element/Attribute subclasses with the features you want. There have
> been discussions about enhancing SAXBuilder to support this built-in. I
> suggest you participate in those discussions (archives online) and in
> the meanwhile just copy SAXBuilder and have it create objects of the
> type you want.
> Downsides: Since you're adding new methods you'll have to do some
> casting. Also, when you create new elements outside the builder you'll
> have to know what kind you want to create.
> Simon Harris wrote:
> > As JDOM appears to provide no factory class, is there any way to have
> > us my own extensions when building from XML?
> > Specifically I'd like to extend Element and Attribute to add some type
> > methods such as Object getTextValue() or the like which would return
> > String/BigDecimal/Boolean/etc. depending on the type defined in the
> > Additionally I'd like the methods to cache the value so as not to have
> > re-parse the text each time it is accessed. Because of this last
> > requirement, it would not be practical (nor effecient IMHO) to have some
> > kind of facade over JDOM.
> > Regards,
> > Simon.
> > _______________________________________________
> > To control your jdom-interest membership:
More information about the jdom-interest