]> git.mxchange.org Git - jcoreee.git/blobdiff - src/org/mxchange/jcoreee/validator/string/names/NameValidator.java
Added flag allowNull to allow null ...
[jcoreee.git] / src / org / mxchange / jcoreee / validator / string / names / NameValidator.java
index a59caa25d9a3d2c7c825b826105bde04909be332..a84a548d49a3e4d37e1b05479e1e571e25290b03 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
+ */
 package org.mxchange.jcoreee.validator.string.names;
 
-import java.text.MessageFormat;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.validator.Validator;
@@ -25,22 +24,28 @@ import org.mxchange.jcoreee.validator.string.BaseStringValidator;
 
 /**
  * A validation class for names, such as first name or family name.
- *
- * @author Roland Haeder
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
  */
 public class NameValidator extends BaseStringValidator implements Validator {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 27_587_896_710_689_451L;
+
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
                // Trace message
-               this.getLogger().logTrace(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N
+               //this.getLogger().logTrace(MessageFormat.format("validate: context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N
 
                // All accepted, required fields
                String[] requiredFileds = {"firstName", "familyName", "city", "street"}; //NOI18N
 
-               // Pre-validation (e.g. not null, not a string, empty string ...)
-               super.preValidate(context, component, value, requiredFileds);
+               // Pre-validation (example: not null, not a string, empty string ...)
+               super.preValidate(context, component, value, requiredFileds, true);
 
                // Trace message
-               this.getLogger().logTrace("validate: EXIT!"); //NOI18N
+               //this.getLogger().logTrace("validate: EXIT!"); //NOI18N
        }
 }