Re: [saxdotnet-devel] ErrorHandler arguments
Brought to you by:
jeffrafter,
kwaclaw
From: Jeff R. <li...@je...> - 2005-01-13 18:48:23
|
> I must have missed this. Could you explain it again? Something like this could be placed in your object heirarchy. One could also very easily create a tee-like observer pattern and some ExceptionHandler class. This could be designed into a subclass ContentHandler and used from within callbacks public FooContentHandler : ContentHandler { public ExceptionHandler exceptionHandler; public void startElement(...) { // some code happens, we need to throw an exception exceptionHandler.Handle(new FooException()); } } public ExceptionHandler { public void Handle(Exception e) throws SAXException { if (....) { } else throw new SAXException(e); } } Now these are just some random ideas thrown out after a long night in the rain so I could be way off. Also, in the back of my mind I am wondering about how Java handles that exception class if not actually thrown. On top of that I saw in some of your examples that you handled a FileNotFound exception in a slightly different way (it seems that IO exceptions would need a slightly different pattern anyway because they are not treated strictly as SAXParseExceptions to begin with). But all of leads me to think that you can have your cake and eat it too... > It would be a simple documentation change. I like simple... Jeff |