1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.qedeq.kernel.xml.parser; |
17 |
|
|
18 |
|
import org.qedeq.base.io.SourceArea; |
19 |
|
import org.qedeq.base.io.SourcePosition; |
20 |
|
import org.qedeq.base.trace.Trace; |
21 |
|
import org.qedeq.kernel.se.common.ModuleService; |
22 |
|
import org.qedeq.kernel.se.common.SourceFileException; |
23 |
|
import org.qedeq.kernel.se.common.SourceFileExceptionList; |
24 |
|
import org.xml.sax.ErrorHandler; |
25 |
|
import org.xml.sax.SAXException; |
26 |
|
import org.xml.sax.SAXParseException; |
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
@author |
33 |
|
|
|
|
| 76.2% |
Uncovered Elements: 5 (21) |
Complexity: 4 |
Complexity Density: 0.24 |
|
34 |
|
public class SaxErrorHandler implements ErrorHandler { |
35 |
|
|
36 |
|
|
37 |
|
private static final Class CLASS = SaxErrorHandler.class; |
38 |
|
|
39 |
|
|
40 |
|
public static final int SAX_PARSER_EXCEPTION = 9001; |
41 |
|
|
42 |
|
|
43 |
|
private final ModuleService plugin; |
44 |
|
|
45 |
|
|
46 |
|
private final String url; |
47 |
|
|
48 |
|
|
49 |
|
private final SourceFileExceptionList list; |
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
@param |
55 |
|
@param |
56 |
|
@param |
57 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
58 |
287
|
public SaxErrorHandler(final ModuleService plugin, final String url,... |
59 |
|
final SourceFileExceptionList list) { |
60 |
287
|
super(); |
61 |
287
|
Trace.param(CLASS, this, "SaxErrorHandler", "url", url); |
62 |
287
|
this.plugin = plugin; |
63 |
287
|
this.url = url; |
64 |
287
|
this.list = list; |
65 |
|
} |
66 |
|
|
67 |
|
|
68 |
|
@see |
69 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
70 |
0
|
public final void warning(final SAXParseException e) throws SAXException {... |
71 |
0
|
final SourceFileException sf = new SourceFileException(plugin, SAX_PARSER_EXCEPTION, e.getMessage(), |
72 |
|
e, new SourceArea(url, new SourcePosition(e.getLineNumber(), 1), |
73 |
|
new SourcePosition(e.getLineNumber(), e.getColumnNumber())), null); |
74 |
0
|
Trace.trace(CLASS, this, "warning", e); |
75 |
0
|
Trace.trace(CLASS, this, "warning", sf); |
76 |
0
|
list.add(sf); |
77 |
|
} |
78 |
|
|
79 |
|
|
80 |
|
@see |
81 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
82 |
34
|
public final void error(final SAXParseException e) throws SAXException {... |
83 |
34
|
final SourceFileException sf = new SourceFileException(plugin, SAX_PARSER_EXCEPTION, e.getMessage(), |
84 |
|
e, new SourceArea(url, new SourcePosition(e.getLineNumber(), 1), |
85 |
|
new SourcePosition(e.getLineNumber(), e.getColumnNumber())), null); |
86 |
34
|
Trace.trace(CLASS, this, "error", e); |
87 |
34
|
Trace.trace(CLASS, this, "error", sf); |
88 |
34
|
list.add(sf); |
89 |
|
} |
90 |
|
|
91 |
|
|
92 |
|
@see |
93 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
94 |
1
|
public final void fatalError(final SAXParseException e) throws SAXException {... |
95 |
1
|
final SourceFileException sf = new SourceFileException(plugin, SAX_PARSER_EXCEPTION, e.getMessage(), |
96 |
|
e, new SourceArea(url, new SourcePosition(e.getLineNumber(), 1), |
97 |
|
new SourcePosition(e.getLineNumber(), e.getColumnNumber())), null); |
98 |
1
|
Trace.trace(CLASS, this, "fatalError", e); |
99 |
1
|
Trace.trace(CLASS, this, "fatalError", sf); |
100 |
1
|
list.add(sf); |
101 |
|
} |
102 |
|
|
103 |
|
} |