OSDN Git Service

Merge commit 'cb03a1ed529387c1084e04e6f141eb9d35d095b8'
[jindolf/Jindolf.git] / src / main / java / jp / sfjp / jindolf / data / xml / BotherHandler.java
diff --git a/src/main/java/jp/sfjp/jindolf/data/xml/BotherHandler.java b/src/main/java/jp/sfjp/jindolf/data/xml/BotherHandler.java
new file mode 100644 (file)
index 0000000..e6e383c
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * XML custom error-handler
+ *
+ * License : The MIT License
+ * Copyright(c) 2010 MikuToga Partners
+ */
+
+package jp.sfjp.jindolf.data.xml;
+
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/**
+ * 自製エラーハンドラ。
+ *
+ * <p>例外を渡されれば即投げ返す。
+ */
+public final class BotherHandler implements ErrorHandler{
+
+    /**
+     * 唯一のシングルトン。
+     */
+    public static final ErrorHandler HANDLER = new BotherHandler();
+
+
+    /**
+     * 隠しコンストラクタ。
+     */
+    private BotherHandler(){
+        super();
+        return;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     *
+     * @param exception {@inheritDoc}
+     * @throws SAXException {@inheritDoc}
+     */
+    @Override
+    public void error(SAXParseException exception) throws SAXException{
+        throw exception;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @param exception {@inheritDoc}
+     * @throws SAXException {@inheritDoc}
+     */
+    @Override
+    public void fatalError(SAXParseException exception) throws SAXException{
+        throw exception;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @param exception {@inheritDoc}
+     * @throws SAXException {@inheritDoc}
+     */
+    @Override
+    public void warning(SAXParseException exception) throws SAXException{
+        throw exception;
+    }
+
+}