]> git.mxchange.org Git - jcore-utils.git/blobdiff - src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java
BaseEeSystem is now centralized and serializable
[jcore-utils.git] / src / org / mxchange / jcoreee / validator / string / BaseStringValidator.java
index b24565631f8c654917569c9e8b2ef2348936683b..d64f5b53d3ede8d5ed0a793007d7c7da95fccbc3 100644 (file)
@@ -29,6 +29,10 @@ import org.mxchange.jcoreee.validator.BaseObjectValidator;
  * @author Roland Haeder<roland@mxchange.org>
  */
 public abstract class BaseStringValidator extends BaseObjectValidator {
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 15_484_578_781_760_287L;
 
        @Override
        protected void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields) throws ValidatorException {
@@ -53,7 +57,7 @@ public abstract class BaseStringValidator extends BaseObjectValidator {
                                // Compare value's type
                                if (!(value instanceof String)) {
                                        // Value is empty
-                                       errKey = String.format("error_%s_is_not_string", field); //NOI18N
+                                       errKey = String.format("ERROR_%s_IS_NOT_STRING", field.toUpperCase()); //NOI18N
 
                                        facesMessage = new FacesMessage(getMessageStringFromKey(errKey));
                                }
@@ -64,7 +68,7 @@ public abstract class BaseStringValidator extends BaseObjectValidator {
                                // Is it empty?
                                if (str.isEmpty()) {
                                        // Value is empty
-                                       errKey = String.format("error_%s_is_empty", field); //NOI18N
+                                       errKey = String.format("ERROR_%s_IS_EMPTY", field.toUpperCase()); //NOI18N
 
                                        facesMessage = new FacesMessage(getMessageStringFromKey(errKey));
                                }