From be327e3dda6119975acde53ed4f17df52b0b5bc4 Mon Sep 17 00:00:00 2001 From: Olyutorskii Date: Fri, 26 Apr 2013 00:18:07 +0900 Subject: [PATCH] =?utf8?q?XML=E7=95=B0=E5=B8=B8=E7=B3=BB=E3=83=8F=E3=83=B3?= =?utf8?q?=E3=83=89=E3=83=A9=E3=82=92=E5=85=B1=E9=80=9A=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../jp/sourceforge/mikutoga/xml/BotherHandler.java | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/main/java/jp/sourceforge/mikutoga/xml/BotherHandler.java diff --git a/src/main/java/jp/sourceforge/mikutoga/xml/BotherHandler.java b/src/main/java/jp/sourceforge/mikutoga/xml/BotherHandler.java new file mode 100644 index 0000000..5464c18 --- /dev/null +++ b/src/main/java/jp/sourceforge/mikutoga/xml/BotherHandler.java @@ -0,0 +1,63 @@ +/* + * XML custom error-handler + * + * License : The MIT License + * Copyright(c) 2010 MikuToga Partners + */ + +package jp.sourceforge.mikutoga.xml; + +import org.xml.sax.ErrorHandler; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +/** + * 自製エラーハンドラ。 + * 例外を渡されれば即投げる。 + */ +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; + } + +} -- 2.11.0