[jdom-interest] Re: [Fwd: JDOM ?]
arosen at silverstream.com
Fri Mar 15 10:35:50 PST 2002
I like Joe's idea, leave it up to the user to decide the policy. I can
certainly imagine a parser that takes a long time to set up.
I think that if the spec says that they're supposed to be reusable, we
should allow people to easily reuse them, if they choose. If current ones
are in fact always reusable, then everything's good. If they aren't reusable
after an exception, then the user can throw away the SAXBuilder after an
exception. Either way, it's not our fault. It would be our fault if a parser
were reusable and we didn't let the user (easily) reuse it.
> -----Original Message-----
> From: jdom-interest-admin at jdom.org
> [mailto:jdom-interest-admin at jdom.org]On Behalf Of Jason Hunter
> Sent: Thursday, March 14, 2002 8:13 PM
> To: Joseph Bowbeer
> Cc: jdom-interest at jdom.org
> Subject: Re: [jdom-interest] Re: [Fwd: JDOM ?]
> 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.
> 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:
To control your jdom-interest membership:
More information about the jdom-interest