From fc44d4bcad00192f0df8f6086737b9b126094dcd Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Thu, 26 Sep 2013 15:48:43 +0200 Subject: initial code commit --- .../pdfas/common/exceptions/PDFIOException.java | 20 ++++++++++++++ .../pdfas/common/exceptions/PdfAsException.java | 31 ++++++++++++++++++++++ .../common/exceptions/PdfAsSettingsException.java | 20 ++++++++++++++ .../egiz/pdfas/common/exceptions/package-info.java | 8 ++++++ 4 files changed, 79 insertions(+) create mode 100644 pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PDFIOException.java create mode 100644 pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PdfAsException.java create mode 100644 pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PdfAsSettingsException.java create mode 100644 pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/package-info.java (limited to 'pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions') diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PDFIOException.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PDFIOException.java new file mode 100644 index 00000000..57c1e7ab --- /dev/null +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PDFIOException.java @@ -0,0 +1,20 @@ +package at.gv.egiz.pdfas.common.exceptions; + +/** + * Created with IntelliJ IDEA. + * User: afitzek + * Date: 8/28/13 + * Time: 12:04 PM + * To change this template use File | Settings | File Templates. + */ +public class PDFIOException extends PdfAsException { + + public PDFIOException(String msgId) { + super(msgId); + } + + + public PDFIOException(String msgId, Throwable e) { + super(msgId, e); + } +} diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PdfAsException.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PdfAsException.java new file mode 100644 index 00000000..e36aa082 --- /dev/null +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PdfAsException.java @@ -0,0 +1,31 @@ +package at.gv.egiz.pdfas.common.exceptions; + +import at.gv.egiz.pdfas.common.messages.MessageResolver; + +public class PdfAsException extends Exception { + public PdfAsException() { + super(); + } + + public PdfAsException(String msgId) { + super(msgId); + } + + public PdfAsException(String msgId, Throwable e) { + super(msgId, e); + } + + @Override + public String getMessage() { + return localizeMessage(super.getMessage()); + } + + @Override + public String getLocalizedMessage() { + return localizeMessage(super.getMessage()); + } + + protected String localizeMessage(String msgId) { + return MessageResolver.resolveMessage(msgId); + } +} diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PdfAsSettingsException.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PdfAsSettingsException.java new file mode 100644 index 00000000..431ffa5d --- /dev/null +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/PdfAsSettingsException.java @@ -0,0 +1,20 @@ +package at.gv.egiz.pdfas.common.exceptions; + +/** + * Created with IntelliJ IDEA. + * User: afitzek + * Date: 9/10/13 + * Time: 10:54 AM + * To change this template use File | Settings | File Templates. + */ +public class PdfAsSettingsException extends PdfAsException { + + public PdfAsSettingsException(String msgId) { + super(msgId); + } + + + public PdfAsSettingsException(String msgId, Throwable e) { + super(msgId, e); + } +} diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/package-info.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/package-info.java new file mode 100644 index 00000000..cfd6a993 --- /dev/null +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/package-info.java @@ -0,0 +1,8 @@ +/** + * + */ +/** + * @author afitzek + * + */ +package at.gv.egiz.pdfas.common.exceptions; \ No newline at end of file -- cgit v1.2.3