From 6f186acbca98f45726401346b229ed9a2a0a3a65 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 12 Oct 2015 11:58:34 +0200 Subject: [PATCH] =?utf8?q?also=20allow=20null=20here,=20if=20requested=20+?= =?utf8?q?=20log=20value=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../mxchange/jcoreee/validator/bool/BaseBooleanValidator.java | 2 +- .../mxchange/jcoreee/validator/number/BaseLongValidator.java | 4 ++-- .../jcoreee/validator/string/BaseStringValidator.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java b/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java index 57ccb3b..5ddf0ff 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 = MessageFormat.format("Field {0} is not Boolean.", field); //NOI18N + requiredMessage = MessageFormat.format("Field {0} is not Boolean: {1}", field, value); //NOI18N // 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 b5475d0..dcfbd8c 100644 --- a/src/org/mxchange/jcoreee/validator/number/BaseLongValidator.java +++ b/src/org/mxchange/jcoreee/validator/number/BaseLongValidator.java @@ -57,9 +57,9 @@ public abstract class BaseLongValidator extends BaseObjectValidator implements V // Is it the same? if (clientId.endsWith(field)) { // Compare value's type - if (!(value instanceof Long)) { + if ((!allowNull) && (!(value instanceof Long))) { // Generate message - requiredMessage = MessageFormat.format("Field {0} is not Long.", field); //NOI18N + requiredMessage = MessageFormat.format("Field {0} is not Long.: {1}", field, value); //NOI18N // Value is not right type facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, requiredMessage, requiredMessage); //NOI18N diff --git a/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java b/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java index 159fc50..02bb160 100644 --- a/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java +++ b/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java @@ -56,9 +56,9 @@ public abstract class BaseStringValidator extends BaseObjectValidator { // Is it the same? if (clientId.endsWith(field)) { // Compare value's type - if (!(value instanceof String)) { + if ((!allowNull) && (!(value instanceof String))) { // Value is empty - facesMessage = new FacesMessage(MessageFormat.format("Field {0} is not set to String.", field)); //NOI18N + facesMessage = new FacesMessage(MessageFormat.format("Field {0} is not String: {1}", field, value)); //NOI18N } // Cast to string -- 2.39.5