Package org.gwtoolbox.widget.client.form.validation.validator

Source Code of org.gwtoolbox.widget.client.form.validation.validator.NotNullValidator

package org.gwtoolbox.widget.client.form.validation.validator;

import org.gwtoolbox.widget.client.form.validation.ValidationMessages;
import org.gwtoolbox.widget.client.form.validation.ValidationResult;
import org.gwtoolbox.widget.client.form.validation.Validator;

/**
* @author Uri Boness
*/
public class NotNullValidator implements Validator {

    public ValidationResult validate(Object value) {
        if (value == null) {
            return new ValidationResult(ValidationMessages.Instance.get().notNull());
        }
        return new ValidationResult();
    }
}
TOP

Related Classes of org.gwtoolbox.widget.client.form.validation.validator.NotNullValidator

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.