]> git.mxchange.org Git - jcore-utils.git/blobdiff - src/org/mxchange/jcoreee/validator/BaseObjectValidator.java
Continued a bit:
[jcore-utils.git] / src / org / mxchange / jcoreee / validator / BaseObjectValidator.java
index 1e27a4d79c2876b68be1112c8e7e32950fa3be4f..5a301e4ab190f8aa7c7a9630188123a645d2970d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Roland Haeder
+ * Copyright (C) 2016, 2017 Roland Häder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@ import javax.faces.validator.ValidatorException;
  * You also may want to try out some other BaseFooValidator classes before
  * directly inheriting from this class.
  * <p>
- * @author Roland Haeder<roland@mxchange.org>
+ * @author Roland Häder<roland@mxchange.org>
  */
 public abstract class BaseObjectValidator implements Validator, Serializable {
 
@@ -43,14 +43,14 @@ public abstract class BaseObjectValidator implements Validator, Serializable {
         * Needs to be implemented as the Validator interface needs to be
         * implemented.
         * <p>
-        * @param context
-        * @param component
-        * @param value
+        * @param context FacesContext instance
+        * @param component UIComponent instance
+        * @param value Value to check
         * <p>
         * @throws ValidatorException
         */
        @Override
-       abstract public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException;
+       public abstract void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException;
 
        /**
         * The method pre-validates the given value. It makes sure that the
@@ -68,7 +68,7 @@ public abstract class BaseObjectValidator implements Validator, Serializable {
         */
        protected void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields, boolean allowNull) throws ValidatorException {
                // Trace message
-               //this.getLogger().logTrace(MessageFormat.format("preValidate: context={0},component={1},value={2},requiredFields={3} - CALLED!", context, component, value, Arrays.toString(requiredFields))); //NOI18N
+               //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("preValidate: context={0},component={1},value={2},requiredFields={3} - CALLED!", context, component, value, Arrays.toString(requiredFields))); //NOI18N
 
                // Init message and key
                FacesMessage facesMessage = null;
@@ -102,20 +102,23 @@ public abstract class BaseObjectValidator implements Validator, Serializable {
 
                // Debug message
                //this.getLogger().logDebug(MessageFormat.format("preValidate: isValidField={0}", isValidField)); //NOI18N
+
                // Valid field?
                if (!isValidField) {
                        // Invalid field
-                       facesMessage = new FacesMessage(MessageFormat.format("Valure {0} for clientId={1} is not valid/unexpected.", value, clientId)); //NOI18N
+                       facesMessage = new FacesMessage(MessageFormat.format("Value {0} for clientId={1} is not valid/unexpected.", value, clientId)); //NOI18N
                }
 
                // Debug message
                //this.getLogger().logDebug(MessageFormat.format("preValidate: facesMessage={0}", facesMessage)); //NOI18N
+
                // Is it not null?
                if (null != facesMessage) {
                        throw new ValidatorException(facesMessage);
                }
 
                // Trace message
-               //this.getLogger().logTrace("preValidate: EXIT!"); //NOI18N
+               //* NOISY-DEBUG: */ System.out.println("preValidate: EXIT!"); //NOI18N
        }
+
 }