[jdom-interest] JDOMFactory

philip.nelson at omniresources.com philip.nelson at omniresources.com
Tue Jun 12 06:02:10 PDT 2001

> One of the things I'd like to be able to do with the pluggable factory
> thing is to make certain creations illegal. I would like the ability
> to be able to decide based on some contextual or other mechanism if
> something is legal or not.
> A simple protocol where the factory methods could throw an exception,
> which is propagated to the caller of the parser would be great. If
> there is no exception then creation proceeds normally.

If I remember correctly, the original exceptions thrown when the JDOM nodes
were created with illegal values where checked exceptions but the
inconvienience of having to try/catch on what is primarly good values, moved
the api to runtime exceptions instead.  

SAXBuilder will catch these exceptions so the propogation back up to the
caller is also handled for you.  Make sense?

More information about the jdom-interest mailing list