annotate NGSrich_0.5.5/src/org/jdom/input/BuilderErrorHandler.java @ 0:89ad0a9cca52 default tip

Uploaded
author pfrommolt
date Mon, 21 Nov 2011 08:12:19 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
1 /*--
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
2
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
3 $Id: BuilderErrorHandler.java,v 1.13 2007/11/10 05:29:00 jhunter Exp $
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
4
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
5 Copyright (C) 2000-2007 Jason Hunter & Brett McLaughlin.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
6 All rights reserved.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
7
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
8 Redistribution and use in source and binary forms, with or without
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
9 modification, are permitted provided that the following conditions
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
10 are met:
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
11
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
12 1. Redistributions of source code must retain the above copyright
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
13 notice, this list of conditions, and the following disclaimer.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
14
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
15 2. Redistributions in binary form must reproduce the above copyright
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
16 notice, this list of conditions, and the disclaimer that follows
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
17 these conditions in the documentation and/or other materials
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
18 provided with the distribution.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
19
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
20 3. The name "JDOM" must not be used to endorse or promote products
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
21 derived from this software without prior written permission. For
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
22 written permission, please contact <request_AT_jdom_DOT_org>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
23
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
24 4. Products derived from this software may not be called "JDOM", nor
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
25 may "JDOM" appear in their name, without prior written permission
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
26 from the JDOM Project Management <request_AT_jdom_DOT_org>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
27
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
28 In addition, we request (but do not require) that you include in the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
29 end-user documentation provided with the redistribution and/or in the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
30 software itself an acknowledgement equivalent to the following:
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
31 "This product includes software developed by the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
32 JDOM Project (http://www.jdom.org/)."
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
33 Alternatively, the acknowledgment may be graphical using the logos
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
34 available at http://www.jdom.org/images/logos.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
35
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
36 THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
37 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
38 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
39 DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
40 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
41 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
42 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
43 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
44 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
45 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
46 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
47 SUCH DAMAGE.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
48
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
49 This software consists of voluntary contributions made by many
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
50 individuals on behalf of the JDOM Project and was originally
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
51 created by Jason Hunter <jhunter_AT_jdom_DOT_org> and
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
52 Brett McLaughlin <brett_AT_jdom_DOT_org>. For more information
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
53 on the JDOM Project, please see <http://www.jdom.org/>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
54
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
55 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
56
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
57 package org.jdom.input;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
58
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
59 import org.xml.sax.*;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
60
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
61 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
62 * The standard JDOM error handler implementation.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
63 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
64 * @author Jason Hunter
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
65 * @version $Revision: 1.13 $, $Date: 2007/11/10 05:29:00 $
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
66 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
67
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
68 public class BuilderErrorHandler implements ErrorHandler {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
69
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
70 private static final String CVS_ID =
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
71 "@(#) $RCSfile: BuilderErrorHandler.java,v $ $Revision: 1.13 $ $Date: 2007/11/10 05:29:00 $ $Name: jdom_1_1_1 $";
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
72
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
73 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
74 * This method is called when a warning has occurred; this indicates
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
75 * that while no XML rules were broken, something appears to be
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
76 * incorrect or missing.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
77 * The implementation of this method here is a "no op".
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
78 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
79 * @param exception <code>SAXParseException</code> that occurred.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
80 * @throws SAXException when things go wrong
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
81 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
82 public void warning(SAXParseException exception) throws SAXException {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
83 // nothing
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
84 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
85
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
86 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
87 * This method is called in response to an error that has occurred;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
88 * this indicates that a rule was broken, typically in validation, but
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
89 * that parsing could reasonably continue.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
90 * The implementation of this method here is to rethrow the exception.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
91 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
92 * @param exception <code>SAXParseException</code> that occurred.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
93 * @throws SAXException when things go wrong
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
94 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
95 public void error(SAXParseException exception) throws SAXException {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
96 throw exception;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
97 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
98
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
99 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
100 * This method is called in response to a fatal error; this indicates that
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
101 * a rule has been broken that makes continued parsing either impossible
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
102 * or an almost certain waste of time.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
103 * The implementation of this method here is to rethrow the exception.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
104 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
105 * @param exception <code>SAXParseException</code> that occurred.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
106 * @throws SAXException when things go wrong
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
107 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
108 public void fatalError(SAXParseException exception) throws SAXException {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
109 throw exception;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
110 }
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
111 }