Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-commons Wiki" 
for change notification.

The following page has been changed by SimonKitching:
http://wiki.apache.org/jakarta-commons/Digester/FAQ

The comment on the change is:
Fix incorrect info about all Rule classes being stateless.

------------------------------------------------------------------------------
  A much cleaner solution is simply to create a new Digester instance for each 
XML
  document parsed. If you are concerned about performance then you might want 
to 
  create a !RulesBase object, add rule instances to it, then reuse that object 
but 
- create a separate Digester object each time. Unlike the Digester class, the 
Rule
- and !RulesBase classes are not supposed to be modified by the parsing, ie are 
- "stateless" with respect to the sax parsing stage and so are pretty safe to 
reuse.
+ create a separate Digester object each time. Re-using rule instances can be
+ unsafe, however. The majority of Rule classes are stateless, but some are not.
+ Of the ones that do retain state, they are ''probably'' safe to reuse if the
+ parse was successful. When an error occurred during a digester parse, however,
+ these rules may well have internal state that will cause them to work 
incorrectly
+ on a future parse. Sorry, there is no list indicating which Rule classes are
+ stateless and which are not; you'll have to look at the source code for each
+ Rule class to figure that out.
  
  You can also create a parser object and pass it to the digester constructor, 
to 
  save having to instantiate a new parser object when new Digester objects are

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to