Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Elements, Nodes classes, and generics

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Steve Loughran <steve.loughran AT gmail.com>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Elements, Nodes classes, and generics
  • Date: Wed, 4 Jan 2006 20:52:30 +0000

On 1/4/06, Calum MacLean <cnmaclean AT hotmail.com> wrote:
> Hi
>
> I've just starting using XOM, and so far it looks excellent.
>
> I want to ask about the custom Nodes and Elements classes, and generics.
> I can understand the reasoning behind choosing to use custom classes, given
> that pre-Java 5.0 didn't have generics.
>
> Given that Java 5.0 has been out for a while now, are there any plans to
> rectify this situation and to use List<Element>, List<Node> etc. instead?
>
> I understand that there's a issue with still supporting pre-Java 5.0 users
> (I'm guessing this probably constitutes the majority of users). But are
> there any plans to support Java 5.0 users in a more standard way?

I have some Java 5 iterators and things to provide typed access to
stuff, then, with every factory-created element being at least an
instance of my ExtendedElement, its fairly easy to work with this
stuff in Xom today. The primary gain is an iterator over node children
of an Element. I havent done more strongly typed (e.g iterate over
comments/text/elements) because then you have to do lookahead and type
checking, and soon encounter the fact that Java5 generics are in fact
bogus compared to say, those of Standard ML, and so its essentially
impossible to do properly. (i.e. the template type is not available at
run time; the binding is at compile time)

were sourceforge CVS-to-http working right now I'd point you at it.
Instead you have to check out core/components/xml from
http://sourceforge.net/projects/smartfrog

-steve




Archive powered by MHonArc 2.6.24.

Top of Page