01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.xerces.jaxp.validation;
19:
20: import org.xml.sax.ErrorHandler;
21: import org.xml.sax.SAXException;
22: import org.xml.sax.SAXParseException;
23:
24: /**
25: * {@link ErrorHandler} that throws all errors and fatal errors.
26: *
27: * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
28: * @version $Id: DraconianErrorHandler.java 447235 2006-09-18 05:01:44Z mrglavas $
29: */
30: final class DraconianErrorHandler implements ErrorHandler {
31:
32: /**
33: * Singleton instance.
34: */
35: private static final DraconianErrorHandler ERROR_HANDLER_INSTANCE = new DraconianErrorHandler();
36:
37: private DraconianErrorHandler() {
38: }
39:
40: /** Returns the one and only instance of this error handler. */
41: public static DraconianErrorHandler getInstance() {
42: return ERROR_HANDLER_INSTANCE;
43: }
44:
45: /** Warning: Ignore. */
46: public void warning(SAXParseException e) throws SAXException {
47: // noop
48: }
49:
50: /** Error: Throws back SAXParseException. */
51: public void error(SAXParseException e) throws SAXException {
52: throw e;
53: }
54:
55: /** Fatal Error: Throws back SAXParseException. */
56: public void fatalError(SAXParseException e) throws SAXException {
57: throw e;
58: }
59:
60: } // DraconianErrorHandler
|