From fd43529ea3b787833e594371eeac3f70b56bc9e9 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Tue, 29 Sep 2015 11:33:02 +0200 Subject: [PATCH] =?utf8?q?Continued:=20-=20renamed=20method=20to=20getMess?= =?utf8?q?ageFromKey()=20as=20this=20is=20better=20-=20made=20getter=20pri?= =?utf8?q?vate=20as=20getMessageFromKey()=20should=20be=20used=20Signed-of?= =?utf8?q?f-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/org/mxchange/jcoreee/BaseEeSystem.java | 4 ++-- src/org/mxchange/jcoreee/validator/BaseObjectValidator.java | 4 ++-- .../mxchange/jcoreee/validator/bool/BaseBooleanValidator.java | 2 +- .../mxchange/jcoreee/validator/number/BaseLongValidator.java | 4 ++-- .../jcoreee/validator/string/BaseStringValidator.java | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/org/mxchange/jcoreee/BaseEeSystem.java b/src/org/mxchange/jcoreee/BaseEeSystem.java index d31d94d..357b1b7 100644 --- a/src/org/mxchange/jcoreee/BaseEeSystem.java +++ b/src/org/mxchange/jcoreee/BaseEeSystem.java @@ -50,7 +50,7 @@ public abstract class BaseEeSystem implements Serializable { *

* @return Bundle instance */ - protected ResourceBundle getBundle () { + private ResourceBundle getBundle () { return this.bundle; } @@ -60,7 +60,7 @@ public abstract class BaseEeSystem implements Serializable { * @param key Key to get message from * @return Message */ - protected String getMessageStringFromKey (final String key) { + protected String getMessageFromKey (final String key) { // Is the bundle loaded? if (this.getBundle() == null) { // Abort here diff --git a/src/org/mxchange/jcoreee/validator/BaseObjectValidator.java b/src/org/mxchange/jcoreee/validator/BaseObjectValidator.java index ce9143e..a8bd8fc 100644 --- a/src/org/mxchange/jcoreee/validator/BaseObjectValidator.java +++ b/src/org/mxchange/jcoreee/validator/BaseObjectValidator.java @@ -93,7 +93,7 @@ public abstract class BaseObjectValidator extends BaseEeSystem implements Valida errKey = String.format("ERROR_%s_IS_NULL", field.toUpperCase()); //NOI18N // Value it null - facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey)); + facesMessage = new FacesMessage(this.getMessageFromKey(errKey)); } // Abort here @@ -106,7 +106,7 @@ public abstract class BaseObjectValidator extends BaseEeSystem implements Valida // Valid field? if (!isValidField) { // Invalid field - facesMessage = new FacesMessage(MessageFormat.format(this.getMessageStringFromKey(errKey), clientId)); + facesMessage = new FacesMessage(MessageFormat.format(this.getMessageFromKey(errKey), clientId)); } // Debug message diff --git a/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java b/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java index a8ce93d..a7a9083 100644 --- a/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java +++ b/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java @@ -62,7 +62,7 @@ public abstract class BaseBooleanValidator extends BaseObjectValidator implement // Compare value's type if (!(value instanceof Boolean)) { // Generate message - requiredMessage = this.getMessageStringFromKey(String.format("ERROR_%s_IS_NOT_BOOLEAN", field.toUpperCase())); + requiredMessage = this.getMessageFromKey(String.format("ERROR_%s_IS_NOT_BOOLEAN", field.toUpperCase())); // Value is not right type facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, requiredMessage, requiredMessage); //NOI18N diff --git a/src/org/mxchange/jcoreee/validator/number/BaseLongValidator.java b/src/org/mxchange/jcoreee/validator/number/BaseLongValidator.java index 5603402..8d543aa 100644 --- a/src/org/mxchange/jcoreee/validator/number/BaseLongValidator.java +++ b/src/org/mxchange/jcoreee/validator/number/BaseLongValidator.java @@ -58,7 +58,7 @@ public abstract class BaseLongValidator extends BaseObjectValidator implements V // Compare value's type if (!(value instanceof Long)) { // Generate message - requiredMessage = this.getMessageStringFromKey(String.format("ERROR_%s_IS_NOT_LONG", field.toUpperCase())); + requiredMessage = this.getMessageFromKey(String.format("ERROR_%s_IS_NOT_LONG", field.toUpperCase())); // Value is not right type facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, requiredMessage, requiredMessage); //NOI18N @@ -71,7 +71,7 @@ public abstract class BaseLongValidator extends BaseObjectValidator implements V // Is the number below zero? if (num < 0) { // Generate message - requiredMessage = this.getMessageStringFromKey(String.format("ERROR_%s_IS_BELOW_ZERO", field.toUpperCase())); + requiredMessage = this.getMessageFromKey(String.format("ERROR_%s_IS_BELOW_ZERO", field.toUpperCase())); // Abort processing here facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, requiredMessage, requiredMessage); diff --git a/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java b/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java index cae887c..5fc4535 100644 --- a/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java +++ b/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java @@ -60,7 +60,7 @@ public abstract class BaseStringValidator extends BaseObjectValidator { // Value is empty errKey = String.format("ERROR_%s_IS_NOT_STRING", field.toUpperCase()); //NOI18N - facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey)); + facesMessage = new FacesMessage(this.getMessageFromKey(errKey)); } // Cast to string @@ -71,7 +71,7 @@ public abstract class BaseStringValidator extends BaseObjectValidator { // Value is empty errKey = String.format("ERROR_%s_IS_EMPTY", field.toUpperCase()); //NOI18N - facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey)); + facesMessage = new FacesMessage(this.getMessageFromKey(errKey)); } } } -- 2.39.5