]> git.mxchange.org Git - jcore-utils.git/blobdiff - src/org/mxchange/jcoreee/validator/BaseObjectValidator.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 / BaseObjectValidator.java
index a8bd8fcab8cc22a622bfd47e990be4631b9be13a..fa3d625333a19deb0935349e8536f2ca71a99d3c 100644 (file)
@@ -22,7 +22,6 @@ import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.validator.Validator;
 import javax.faces.validator.ValidatorException;
-import org.mxchange.jcoreee.BaseEeSystem;
 
 /**
  * A general object validation class. Please implement
@@ -32,7 +31,7 @@ import org.mxchange.jcoreee.BaseEeSystem;
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
-public abstract class BaseObjectValidator extends BaseEeSystem implements Validator {
+public abstract class BaseObjectValidator implements Validator {
 
        /**
         * Serial number
@@ -69,7 +68,6 @@ public abstract class BaseObjectValidator extends BaseEeSystem implements Valida
 
                // Init message and key
                FacesMessage facesMessage = null;
-               String errKey = "ERROR_UNKNOWN_ID"; //NOI18N
 
                // Get client id
                final String clientId = component.getClientId();
@@ -89,11 +87,8 @@ public abstract class BaseObjectValidator extends BaseEeSystem implements Valida
 
                                // Is it null?
                                if (null == value) {
-                                       // Generate message
-                                       errKey = String.format("ERROR_%s_IS_NULL", field.toUpperCase()); //NOI18N
-
                                        // Value it null
-                                       facesMessage = new FacesMessage(this.getMessageFromKey(errKey));
+                                       facesMessage = new FacesMessage(MessageFormat.format("Field {0} is null.", field)); //NOI18N
                                }
 
                                // Abort here
@@ -106,7 +101,7 @@ public abstract class BaseObjectValidator extends BaseEeSystem implements Valida
                // Valid field?
                if (!isValidField) {
                        // Invalid field
-                       facesMessage = new FacesMessage(MessageFormat.format(this.getMessageFromKey(errKey), clientId));
+                       facesMessage = new FacesMessage(MessageFormat.format("Valure {0} for clientId={1} is not valid/unexpected.", value, clientId)); //NOI18N
                }
 
                // Debug message