users@jaxb.java.net

Re: JAXB error output

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 05 Mar 2003 09:59:50 -0800

> Can some one provide me how to print out error lines and the node the error
> was from?

You basically need to set your own ValidationErrorHandler, and write the
code to print errors. Every time an unmarshaller/validator/marshaller
finds an error, it will call the handleEvent method.

Your implementation of this method can access the ValidationEvent object,
which contains the information about the error.

In your case, you would be interested in:

- the error message (event.getMessage())
- the location (event.getLocator().getLineNumber() if you are unmarshalling)


regards,
--
Kohsuke KAWAGUCHI                  408-276-7063 (x17063)
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com