X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2Forg%2Fmxchange%2Fjcoreee%2Fvalidator%2Fstring%2Fnames%2FNameValidator.java;h=6114c4d7ad45e0ab73825f5bcfd7ee2944722c0b;hb=393cb4e68d698408ab5bee14caa935ad534efbf0;hp=8325169db3f6d838eec8d027a0c822bf76bf23a2;hpb=a53a324e453d154ccefbbb4b8dc3290c78a28cce;p=jcore-utils.git
diff --git a/src/org/mxchange/jcoreee/validator/string/names/NameValidator.java b/src/org/mxchange/jcoreee/validator/string/names/NameValidator.java
index 8325169..6114c4d 100644
--- a/src/org/mxchange/jcoreee/validator/string/names/NameValidator.java
+++ b/src/org/mxchange/jcoreee/validator/string/names/NameValidator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015 Roland Haeder
+ * Copyright (C) 2016 Roland Haeder
*
* 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
@@ -13,34 +13,41 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
- */
+ */
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.FacesValidator;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import org.mxchange.jcoreee.validator.string.BaseStringValidator;
/**
* A validation class for names, such as first name or family name.
- *
- * @author Roland Haeder
+ *
+ * @author Roland Haeder
*/
+@FacesValidator (value = "NameValidator")
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().trace(MessageFormat.format("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().trace("EXIT!"); //NOI18N
+ //this.getLogger().logTrace("validate: EXIT!"); //NOI18N
}
}