01: /*
02: * Copyright 2002-2008 Andy Clark
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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.cyberneko.html;
18:
19: import org.apache.xerces.xni.parser.XMLParseException;
20:
21: /**
22: * Defines an error reporter for reporting HTML errors. There is no such
23: * thing as a fatal error in parsing HTML. I/O errors are fatal but should
24: * throw an <code>IOException</code> directly instead of reporting an error.
25: * <p>
26: * When used in a configuration, the error reporter instance should be
27: * set as a property with the following property identifier:
28: * <pre>
29: * "http://cyberneko.org/html/internal/error-reporter" in the
30: * </pre>
31: * Components in the configuration can query the error reporter using this
32: * property identifier.
33: * <p>
34: * <strong>Note:</strong>
35: * All reported errors are within the domain "http://cyberneko.org/html".
36: *
37: * @author Andy Clark
38: *
39: * @version $Id: HTMLErrorReporter.java,v 1.4 2005/02/14 03:56:54 andyc Exp $
40: */
41: public interface HTMLErrorReporter {
42:
43: //
44: // HTMLErrorReporter methods
45: //
46:
47: /** Format message without reporting error. */
48: public String formatMessage(String key, Object[] args);
49:
50: /** Reports a warning. */
51: public void reportWarning(String key, Object[] args)
52: throws XMLParseException;
53:
54: /** Reports an error. */
55: public void reportError(String key, Object[] args)
56: throws XMLParseException;
57:
58: } // interface HTMLErrorReporter
|