Class BlankAttributeValidator

    • Constructor Detail

      • BlankAttributeValidator

        public BlankAttributeValidator()
    • Method Detail

      • validate

        public ValidationContext validate​(Object input,
                                          String inputHint,
                                          ValidationContext context,
                                          ValidatorConfig config)
        Description copied from interface: Validator
        Validates the given input with an additional inputHint and config.
        Specified by:
        validate in interface Validator
        input - the value to validate
        inputHint - an optional input hint to guide the validation
        context - the validation context
        config - parameterization for the current validation
        the validation context with the outcome of the validation
      • createConfig

        public static ValidatorConfig createConfig​(String errorMessage,
                                                   boolean failOnNull)
        Create config for this validator to get customized error message
        errorMessage - to be used if validation fails
        failOnNull - makes validator fail on null values also (not on empty string only as is the default behavior)