|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SaxErrorHandler | Line # 27 | 5 | 4 | 33.3% |
0.33333334
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
(1) | |||
Result | |||
0.33333334
|
org.qedeq.kernel.xml.dao.GenerateXmlTest.testGeneration org.qedeq.kernel.xml.dao.GenerateXmlTest.testGeneration | 1 PASS | |
1 | /* This file is part of the project "Hilbert II" - http://www.qedeq.org | |
2 | * | |
3 | * Copyright 2000-2013, Michael Meyling <mime@qedeq.org>. | |
4 | * | |
5 | * "Hilbert II" is free software; you can redistribute | |
6 | * it and/or modify it under the terms of the GNU General Public | |
7 | * License as published by the Free Software Foundation; either | |
8 | * version 2 of the License, or (at your option) any later version. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | */ | |
15 | ||
16 | package org.qedeq.kernel.xml.test; | |
17 | ||
18 | import org.xml.sax.ErrorHandler; | |
19 | import org.xml.sax.SAXParseException; | |
20 | ||
21 | ||
22 | /** | |
23 | * Error handler for XML parsing. | |
24 | * | |
25 | * @author Michael Meyling | |
26 | */ | |
27 | public class SaxErrorHandler implements ErrorHandler { | |
28 | ||
29 | /** Collects errors. */ | |
30 | private ExceptionList list; | |
31 | ||
32 | /** | |
33 | * Constructor. | |
34 | * | |
35 | * @param list Collector for the SAX exceptions. | |
36 | */ | |
37 | 260 | public SaxErrorHandler(final ExceptionList list) { |
38 | 260 | super(); |
39 | 260 | this.list = list; |
40 | } | |
41 | ||
42 | ||
43 | /* (non-Javadoc) | |
44 | * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException) | |
45 | */ | |
46 | 0 | public void warning(SAXParseException e) { |
47 | 0 | list.add(e); |
48 | } | |
49 | ||
50 | /* (non-Javadoc) | |
51 | * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException) | |
52 | */ | |
53 | 0 | public void error(SAXParseException e) { |
54 | 0 | list.add(e); |
55 | } | |
56 | ||
57 | /* (non-Javadoc) | |
58 | * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException) | |
59 | */ | |
60 | 0 | public void fatalError(SAXParseException e) { |
61 | 0 | list.add(e); |
62 | } | |
63 | } |
|