KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > validation > impl > DraconianErrorHandler


1 /*
2  * Copyright 1999-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 package org.apache.cocoon.components.validation.impl;
17
18 import org.xml.sax.ErrorHandler JavaDoc;
19 import org.xml.sax.SAXException JavaDoc;
20 import org.xml.sax.SAXParseException JavaDoc;
21
22 /**
23  * <p>An implementation of the {@link ErrorHandler} interface re-throwing
24  * all exceptions passed to it.</p>
25  *
26  * @author <a HREF="mailto:pier@betaversion.org">Pier Fumagalli</a>
27  */

28 public final class DraconianErrorHandler implements ErrorHandler JavaDoc {
29     
30     /** <p>The singleton instance of the {@link DraconianErrorHandler}.</p> */
31     public static final DraconianErrorHandler INSTANCE = new DraconianErrorHandler();
32
33     /** <p>Deny normal construction of instances of this class.</p> */
34     private DraconianErrorHandler() { }
35
36     /**
37      * <p>Simply re-throw the specified {@link SAXParseException}.</p>
38      */

39     public void warning(SAXParseException JavaDoc exception)
40     throws SAXException JavaDoc {
41         throw exception;
42     }
43
44     /**
45      * <p>Simply re-throw the specified {@link SAXParseException}.</p>
46      */

47     public void error(SAXParseException JavaDoc exception)
48     throws SAXException JavaDoc {
49         throw exception;
50     }
51
52     /**
53      * <p>Simply re-throw the specified {@link SAXParseException}.</p>
54      */

55     public void fatalError(SAXParseException JavaDoc exception)
56     throws SAXException JavaDoc {
57         throw exception;
58     }
59 }
60
Popular Tags