*/
public abstract class BaseStringValidator extends BaseObjectValidator {
- /**
- * Pre-validation of value, e.g. not null
- *
- * @param context FacesContext instance
- * @param component UIComponent instance
- * @param value Value to check
- * @param requiredFields Array of required field names (ending with)
- * @throws ValidatorException If something more horrible went wrong
- */
@Override
protected void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields) throws ValidatorException {
// Trace message
FacesMessage facesMessage = null;
String errKey;
- // So far all fine!
+ // So far all fine, no check if the field is fine
for (final String field : requiredFields) {
// Debug message
this.getLogger().debug(MessageFormat.format("field={0},clientId={1}", field, clientId)); //NOI18N
// Is it the same?
if (clientId.endsWith(field)) {
+ // Compare value's type
if (!(value instanceof String)) {
// Value is empty
errKey = String.format("error.%s.is_not_string", field); //NOI18N