]> git.mxchange.org Git - jcore-utils.git/blobdiff - src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java
Let's get rid of this class. It was maybe a good idea, but it required a lot work...
[jcore-utils.git] / src / org / mxchange / jcoreee / validator / bool / BaseBooleanValidator.java
index 38fa468dcc3de2cc5143f43be9bf7ceefe0abc96..122d0a026261e82a1f5c005ceb285e1effd4949c 100644 (file)
@@ -28,12 +28,17 @@ import org.mxchange.jcoreee.validator.BaseObjectValidator;
 
 /**
  * A general boolean value validator.
- *
+ * <p>
  * @author BalusC
  * @author Roland Haeder<roland@mxchange.org>
  */
 public abstract class BaseBooleanValidator extends BaseObjectValidator implements Validator {
 
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 42_378_178_715_910_689L;
+
        @Override
        public void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields) throws ValidatorException {
                // Trace message
@@ -45,7 +50,7 @@ public abstract class BaseBooleanValidator extends BaseObjectValidator implement
                // Get client id and init message + key
                String clientId = component.getClientId();
                FacesMessage facesMessage = null;
-               String requiredMessage = null;
+               String requiredMessage;
 
                // So far all fine, no check if the field is fine
                for (final String field : requiredFields) {
@@ -57,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 = MessageFormat.format("Field {0} is not Boolean.", field); //NOI18N
 
                                        // Value is not right type
                                        facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, requiredMessage, requiredMessage); //NOI18N