From: Roland Haeder Date: Tue, 29 Sep 2015 09:33:02 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fd43529ea3b787833e594371eeac3f70b56bc9e9;p=jcore-utils.git Continued: - renamed method to getMessageFromKey() as this is better - made getter private as getMessageFromKey() should be used Signed-off-by:Roland Häder --- 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)); } } }