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
* javax.faces.validator.Validator (with import line!) and call preValidate().
* You also may want to try out some other BaseFooValidator classes before
* directly inheriting from this class.
- *
+ * <p>
* @author Roland Haeder<roland@mxchange.org>
*/
-public abstract class BaseObjectValidator extends BaseEeSystem implements Validator {
+public abstract class BaseObjectValidator implements Validator {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 48_574_878_176_939_512L;
/**
* Needs to be implemented as the Validator interface needs to be
* implemented.
- *
+ * <p>
* @param context
* @param component
* @param value
* component's id is found in requiredFields and is not null. Once the
* component's id has been found, it stops iteration on requiredFields
* (which saves execution time).
- *
+ * <p>
* @param context FacesContext instance
* @param component UIComponent instance
* @param value Value to check
// Init message and key
FacesMessage facesMessage = null;
- String errKey = "error.unknown_id"; //NOI18N
// Get client id
final String clientId = component.getClientId();
// Is it null?
if (null == value) {
- errKey = String.format("error.%s.is_null", field); //NOI18N
-
// Value it null
- facesMessage = new FacesMessage(getMessageStringFromKey(errKey));
+ facesMessage = new FacesMessage(MessageFormat.format("Field {0} is null.", field)); //NOI18N
}
// Abort here
// Valid field?
if (!isValidField) {
// Invalid field
- facesMessage = new FacesMessage(MessageFormat.format(errKey, clientId));
+ facesMessage = new FacesMessage(MessageFormat.format("Valure {0} for clientId={1} is not valid/unexpected.", value, clientId)); //NOI18N
}
// Debug message