From: Marco Zanon Date: Thu, 22 Oct 2015 13:23:22 +0000 (+0000) Subject: Renamed MTranslationValueNotFoundTextException to MTranslationValueNotFoundException. X-Git-Tag: 4.0~11 X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=de295f442bf055b6d781d1208aff078df3384396;p=Macaco Renamed MTranslationValueNotFoundTextException to MTranslationValueNotFoundException. --- diff --git a/src/java/com/marcozanon/macaco/text/MTranslationValueNotFoundException.java b/src/java/com/marcozanon/macaco/text/MTranslationValueNotFoundException.java new file mode 100644 index 0000000..bcfdafe --- /dev/null +++ b/src/java/com/marcozanon/macaco/text/MTranslationValueNotFoundException.java @@ -0,0 +1,30 @@ +/** + * Macaco + * Copyright (c) 2009-2015 Marco Zanon . + * Released under MIT license (see LICENSE for details). + */ + +package com.marcozanon.macaco.text; + +@SuppressWarnings("serial") +public class MTranslationValueNotFoundException extends MTranslationException { + + /* */ + + public MTranslationValueNotFoundException() { + super(); + } + + public MTranslationValueNotFoundException(String message) { + super(message); + } + + public MTranslationValueNotFoundException(Throwable error) { + super(error); + } + + public MTranslationValueNotFoundException(String message, Throwable error) { + super(message, error); + } + +} diff --git a/src/java/com/marcozanon/macaco/text/MTranslationValueNotFoundTextException.java b/src/java/com/marcozanon/macaco/text/MTranslationValueNotFoundTextException.java deleted file mode 100644 index 33a016f..0000000 --- a/src/java/com/marcozanon/macaco/text/MTranslationValueNotFoundTextException.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Macaco - * Copyright (c) 2009-2015 Marco Zanon . - * Released under MIT license (see LICENSE for details). - */ - -package com.marcozanon.macaco.text; - -@SuppressWarnings("serial") -public class MTranslationValueNotFoundTextException extends MTranslationException { - - /* */ - - public MTranslationValueNotFoundTextException() { - super(); - } - - public MTranslationValueNotFoundTextException(String message) { - super(message); - } - - public MTranslationValueNotFoundTextException(Throwable error) { - super(error); - } - - public MTranslationValueNotFoundTextException(String message, Throwable error) { - super(message, error); - } - -} diff --git a/src/java/com/marcozanon/macaco/text/MTranslator.java b/src/java/com/marcozanon/macaco/text/MTranslator.java index f724714..3e88e5b 100644 --- a/src/java/com/marcozanon/macaco/text/MTranslator.java +++ b/src/java/com/marcozanon/macaco/text/MTranslator.java @@ -146,16 +146,16 @@ public class MTranslator extends MObject { try { translation = this.getTranslation(message, locale, false); } - catch (MTranslationValueNotFoundTextException exception) { // cannot happen + catch (MTranslationValueNotFoundException exception) { // cannot happen } return translation; } - public String getStrictTranslation(String message, Locale locale) throws MTranslationValueNotFoundTextException { + public String getStrictTranslation(String message, Locale locale) throws MTranslationValueNotFoundException { return this.getTranslation(message, locale, true); } - protected String getTranslation(String message, Locale locale, boolean strictMode) throws MTranslationValueNotFoundTextException { + protected String getTranslation(String message, Locale locale, boolean strictMode) throws MTranslationValueNotFoundException { if (MText.isBlank(message)) { throw new IllegalArgumentException("Invalid 'message': null or empty."); } @@ -165,7 +165,7 @@ public class MTranslator extends MObject { // if (!this.getMessagesReference().containsKey(message)) { if (strictMode) { - throw new MTranslationValueNotFoundTextException(String.format("Invalid 'message': %s: not available.", message)); + throw new MTranslationValueNotFoundException(String.format("Invalid 'message': %s: not available.", message)); } return message; } @@ -176,7 +176,7 @@ public class MTranslator extends MObject { String localeRepresentation = locale.toString(); if (!messageTranslations.containsKey(localeRepresentation)) { if (strictMode) { - throw new MTranslationValueNotFoundTextException(String.format("Invalid 'locale': %s: translation not available for message: %s.", localeRepresentation, message)); + throw new MTranslationValueNotFoundException(String.format("Invalid 'locale': %s: translation not available for message: %s.", localeRepresentation, message)); } String localeFallbackRepresentation = locale.getLanguage(); if (!messageTranslations.containsKey(localeFallbackRepresentation)) {