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

Joseph Bowbeer jozart at csi.com
Tue Mar 12 09:32:27 PST 2002


"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...




More information about the jdom-interest mailing list