OSDN Git Service

1st commit
[mikutoga/Pmd2XML.git] / src / main / java / jp / sourceforge / mikutoga / pmd2xml / XmlHandler.java
1 /*\r
2  * XML custom error-handler\r
3  *\r
4  * License : The MIT License\r
5  * Copyright(c) 2010 MikuToga Partners\r
6  */\r
7 \r
8 package jp.sourceforge.mikutoga.pmd2xml;\r
9 \r
10 import org.xml.sax.ErrorHandler;\r
11 import org.xml.sax.SAXException;\r
12 import org.xml.sax.SAXParseException;\r
13 \r
14 /**\r
15  * 自製エラーハンドラ。\r
16  * 例外を渡されれば即投げる。\r
17  */\r
18 final class XmlHandler implements ErrorHandler{\r
19 \r
20     /**\r
21      * 唯一のシングルトン。\r
22      */\r
23     static final ErrorHandler HANDLER = new XmlHandler();\r
24 \r
25     /**\r
26      * 隠しコンストラクタ。\r
27      */\r
28     private XmlHandler(){\r
29         super();\r
30         return;\r
31     }\r
32 \r
33     /**\r
34      * {@inheritDoc}\r
35      * @param exception {@inheritDoc}\r
36      * @throws SAXException {@inheritDoc}\r
37      */\r
38     @Override\r
39     public void error(SAXParseException exception) throws SAXException{\r
40         throw exception;\r
41     }\r
42 \r
43     /**\r
44      * {@inheritDoc}\r
45      * @param exception {@inheritDoc}\r
46      * @throws SAXException {@inheritDoc}\r
47      */\r
48     @Override\r
49     public void fatalError(SAXParseException exception) throws SAXException{\r
50         throw exception;\r
51     }\r
52 \r
53     /**\r
54      * {@inheritDoc}\r
55      * @param exception {@inheritDoc}\r
56      * @throws SAXException {@inheritDoc}\r
57      */\r
58     @Override\r
59     public void warning(SAXParseException exception) throws SAXException{\r
60         throw exception;\r
61     }\r
62 \r
63 }\r