[jdom-interest] Re: [Fwd: JDOM ?]

Jason Hunter jhunter at acm.org
Thu Mar 14 17:13:00 PST 2002


If parsers aren't 100% reusable (as in after an exception) then
SAXBuilder is wise to recreate them.  It makes SAXBuilder reusable even
if the parser isn't.

I suspect the time to build a parser only matters if you're doing many
super-small documents.  That's probably going to be common with SOAP and
such, so this is something to watch.

Kim, perhaps you want to run some tests on how long it takes to setup
parsers.  Just use a no-op content handler.

-jh-

Joseph Bowbeer wrote:
> 
> "Once this method is invoked, the parser instance is of no further use, and
> should NOT be reused."
> 
> Should we say the same about SAXBuilder's build method?
> 
> In my experience with some older parsers, the parsers are not reusable after
> they've thrown an exception -- even if they are reusable normally.
> 
> Perhaps we can say one SAXBuilder == one parser and leave it to the re-user
> to throw-away the SAXBuilder if an error is encountered.
> 
> (To be safe, and to keep the memory footprint low, I create a new SAXBuilder
> for every document.)
> 
> --- original message ---
> 
> From: Alex Rosen arosen at silverstream.com
> Date: Tue, 12 Mar 2002 10:39:47 -0500
> 
> If we're sure that all parser support being reused (or are supposed to
> support it), then it does seem like a good idea. Doing a quick search, I
> found that the original (i.e. very old) IBM4J parser says this about its
> parsing methods: "Once this method is invoked, the parser instance is of no
> further use, and should NOT be reused." I don't know about newer parsers.
> The JAXP spec doesn't say one way or the other...
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list