[jdom-interest] ValidityException

Jason Hunter jhunter at servlets.com
Tue Jun 17 12:36:59 PDT 2003


Thanks for the patch, Rusty.  Now that I'm back from JavaOne I have some 
time to work on applying it.

First thing I noticed is that this patch breaks the build.  In 
JAXPDOMAdapter for example we have "new Object[]{new 
BuilderErrorHandler()}" but the default constructor of BEH is gone now 
that you added a constructor that takes a boolean validate.  I changed 
it to "new BuilderErrorHandler(validate)" in the various adapter classes 
and now it builds.  I wonder if you didn't see this because of your sync 
problems?

Second thing is, I'm unclear on the purpose for the public class 
SAXValidityException.  Couldn't it be package protected?  It's confusing 
especially since SAXValidityException doesn't extend ValidityException.

Third, can you be sure in BuilderErrorHandler that an error() callback 
means a validation error?

Lastly, the build() call will only throw a ValidityException if our 
standard BuilderErrorHandler is installed.  If they install their own, 
it won't happen anymore.  That seems like an unfortunate side effect.

-jh-

Elliotte Rusty Harold wrote:
> I've attached a patch for several existing files and two new classes for 
> org.jdom.input that together enable JDOM to throw a ValidityException 
> when a validity error is detected instead of a generic JDOMParseException.
> 
> Be careful when applying these. I had some trouble syncing my tree to 
> the latest CVS. I think it's all there now, but do a sanity check first.
> 
> -- 
> Elliotte




More information about the jdom-interest mailing list