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
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
-public abstract class BaseObjectValidator extends BaseEeSystem implements Validator {
+public abstract class BaseObjectValidator implements Validator {
/**
* Serial number
// 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) {
- // 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
// 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