KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > jaxp > validation > DraconianErrorHandler


1 /*
2  * Copyright 2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.xerces.jaxp.validation;
18
19 import org.xml.sax.ErrorHandler JavaDoc;
20 import org.xml.sax.SAXException JavaDoc;
21 import org.xml.sax.SAXParseException JavaDoc;
22
23 /**
24  * {@link ErrorHandler} that throws all errors and fatal errors.
25  *
26  * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
27  * @version $Id: DraconianErrorHandler.java,v 1.2 2005/05/14 19:54:15 mrglavas Exp $
28  */

29 final class DraconianErrorHandler implements ErrorHandler JavaDoc {
30
31     /**
32      * Singleton instance.
33      */

34     private static final DraconianErrorHandler ERROR_HANDLER_INSTANCE
35         = new DraconianErrorHandler();
36     
37     private DraconianErrorHandler() {}
38     
39     /** Returns the one and only instance of this error handler. */
40     public static DraconianErrorHandler getInstance() {
41         return ERROR_HANDLER_INSTANCE;
42     }
43     
44     /** Warning: Ignore. */
45     public void warning(SAXParseException JavaDoc e) throws SAXException JavaDoc {
46         // noop
47
}
48     
49     /** Error: Throws back SAXParseException. */
50     public void error(SAXParseException JavaDoc e) throws SAXException JavaDoc {
51         throw e;
52     }
53     
54     /** Fatal Error: Throws back SAXParseException. */
55     public void fatalError(SAXParseException JavaDoc e) throws SAXException JavaDoc {
56         throw e;
57     }
58     
59 } // DraconianErrorHandler
60
Popular Tags