ErrorHandlerAdaptor.java revision c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.6-b27-fcs
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk// Any modifications to this file will be lost upon recompilation of the source schema.
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk// Generated on: 2012.06.11 at 10:34:16 AM PDT
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenkpackage com.sun.identity.wsfederation.jaxb.entityconfig.impl.runtime;
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenkimport javax.xml.bind.helpers.ValidationEventImpl;
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * Receives errors through {@link ErrorHandler} and reports to the
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * {@link SAXUnmarshallerHandler}.
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenkpublic class ErrorHandlerAdaptor implements ErrorHandler {
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk /** the client event handler that will receive the validation events */
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk /** the locator object responsible for filling in the validation event
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk * location info **/
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk SAXUnmarshallerHandler _host, Locator locator ) {
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk propagateEvent( ValidationEvent.ERROR, exception );
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk public void warning(SAXParseException exception)
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk propagateEvent( ValidationEvent.WARNING, exception );
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk public void fatalError(SAXParseException exception)
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk propagateEvent( ValidationEvent.FATAL_ERROR, exception );
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk private void propagateEvent( int severity, SAXParseException saxException )
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk // get location info:
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk // sax locators simply use the location info embedded in the
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk // sax exception, dom locators keep a reference to their DOMScanner
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk // and call back to figure out where the error occurred.
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk new ValidationEventImpl( severity, saxException.getMessage(), vel );
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk if( e != null ) {
c1350cf5bc50458ba79cc93ff9e0e5fe3f1aeeb0jeff.schenk // call the client's event handler.