commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29428] - Digester does not keep "root" variable in sync...
Date Wed, 09 Jun 2004 01:11:14 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29428>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29428

Digester does not keep "root" variable in sync...





------- Additional Comments From simon@ecnetwork.co.nz  2004-06-09 01:11 -------
Hmm..RuleSetBase is abstract. I'm surprised that there isn't a concrete
implementation of it, except in the xmlrules package.

But it should also be safe to create a Rules object, and add the rules to it.
You should be able to then reuse this Rules object in multiple different
Digester objects.

eg
  Rules myRules = new RulesBase();
  myRules.addRule("foo/bar", new ObjectCreateRule(String.class));

Then 
  digester = new Digester();
  digester.setRules(myRules);

The RulesBase class doesn't have any state that changes during a parse as far as
I can see (unlike the Digester class). So there's no need to "reset" it between
parses. And this is likely to hold true for all the Rules implementations, I think.

I suspect that creating the xml parser object will also be moderately costly, so
suggest that is created once and passed to the Digester (or even more cleanly
have the Digester instance set as the parser's content handler).

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message