Class NullValidator

  • All Implemented Interfaces:
    Validator, Serializable

    @Deprecated
    public class NullValidator
    extends Object
    implements Validator
    Deprecated.
    As of 8.0, no direct replacement available. See Binder.forField(HasValue) and various methods for validation and conversion chaining: withValidator(...), withConverter(...), withNullRepresentation(...)
    This validator is used for validating properties that do or do not allow null values. By default, nulls are not allowed.
    Since:
    3.0
    Author:
    Vaadin Ltd.
    See Also:
    Serialized Form
    • Constructor Detail

      • NullValidator

        public NullValidator​(String errorMessage,
                             boolean onlyNullAllowed)
        Deprecated.
        Creates a new NullValidator.
        Parameters:
        errorMessage - the error message to display on invalidation.
        onlyNullAllowed - Are only nulls allowed?
    • Method Detail

      • isNullAllowed

        public final boolean isNullAllowed()
        Deprecated.
        Returns true if nulls are allowed otherwise false.
      • setNullAllowed

        public void setNullAllowed​(boolean onlyNullAllowed)
        Deprecated.
        Sets if nulls (and only nulls) are to be allowed.
        Parameters:
        onlyNullAllowed - If true, only nulls are allowed. If false only non-nulls are allowed. Do we allow nulls?
      • getErrorMessage

        public String getErrorMessage()
        Deprecated.
        Gets the error message that is displayed in case the value is invalid.
        Returns:
        the Error Message.
      • setErrorMessage

        public void setErrorMessage​(String errorMessage)
        Deprecated.
        Sets the error message to be displayed on invalid value.
        Parameters:
        errorMessage - the Error Message to set.