velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Bachelder" <cho...@chowda.net>
Subject Re: wrapping XML document as JavaBeans?
Date Wed, 03 Oct 2001 03:15:55 GMT
I hate to go off topic again... but speaking of hashmap... here is a very
interesting article on hashmaps and performance... with some numbers on page
2...

http://www.onjava.com/pub/a/onjava/2001/01/25/hash_functions.html

----- Original Message -----
From: "Geir Magnusson Jr." <geirm@optonline.net>
To: <velocity-user@jakarta.apache.org>
Sent: Tuesday, October 02, 2001 9:59 PM
Subject: Re: wrapping XML document as JavaBeans?


> On 10/2/01 9:43 PM, "David Rees" <drees@runt.ebetinc.com> wrote:
> >>
> >> You might also choose to build something path-ish so you can access any
> >> level...
> >
> > Yep, you could easily do this using a HashMap so you don't have to write
a
> > custom container, just something to parse/store it:
> >
> > <object>
> > <value>Data</value>
> > <some>
> >   <othervalue>MoreData</othervalue>
> > </some>
> > </object>
> >
> > object.get("value")
> > object.get("some/othervalue")
> >
> > If you have elements with attributes with the same name as lower
elements,
> > things could get tricky, but that's a pooly designed XML spec anyway.
;-)
>
> I did this for JJAR.  I will pull that code out and see if I can package
it
> up....
>
> It used lists and maps... Pretty cheap and simple..
>
>
> --
> Geir Magnusson Jr.     geirm@optonline.net
> System and Software Consulting
> "They that can give up essential liberty to obtain a little temporary
safety
> deserve neither liberty nor safety." - Benjamin Franklin
>
>
>


Mime
View raw message