You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Jaap van Hengstum <Ja...@indicia.nl> on 2003/07/31 10:16:06 UTC

RE: [Digester] NodeCreateRule indeed doesn't pop and question about exception handling.

> I need to use the NodeCreateRule to parse nested Elements 
> with mixed content in my documents.
> As I always got NoSuchMethodExceptions somewhere after the 
> NodeCreateRule executed, I took a look into the source code 
> and found out, that NodeCreateRule does not overwrite the 
> end() method of  org.apache.commons.digester.Rule. 
> But because of this, the Node does not get popped from the 
> stack when the closing tag is reached.
> I think this is a bug because NodeCreateRule should behave 
> the same way as ObjectCreateRule does.

It was indeed this issue that was causing me problems. Thanks for helping me out on this one.

I also have a small question about the configure() method in the Digester class. I noticed that it doesn't throw any exeptions, while some of the rules (like NodeCreateRule) do when adding them (I subclass the Digester class, just like RSSDigester does). Personally, I'd rather have all the api/utility classes to throw all the exceptions they cause (or have them wrapped inside f.e. a NestedException) so I can deal with them in my main application. I don't know if there are any design guidelines defined for handling exceptions in the common classes, but maybe this is something that can be considered.

Anyway, thanks for the help, I will be monitoring this mailing list for a while since we plan to  use the Commons classes a lot in our current project.