Class BooleanValidator

java.lang.Object
com.jbstrap.core.validators.BooleanValidator
All Implemented Interfaces:
DataValidator

public class BooleanValidator extends Object implements DataValidator
The Boolean validator class
Since:
4.0
Author:
JBStrap
  • Constructor Details

    • BooleanValidator

      public BooleanValidator()
  • Method Details

    • validateData

      public String validateData(Object data, String language)

      Boolean validator

      The specified data is validated, if it's a boolean value, or can be converted into one

      The error message, returned by the method can be customized or have its language set in the validator.booleanValidatorError properties file with the use of a key. For more information about language settings, see the MessageSourceAPI class

      Specified by:
      validateData in interface DataValidator
      Parameters:
      data - The data to be validated
      language - The language code of the error message. If not specified, the default language will be used. The default language can be set with the DEFAULT_LANGUAGE JBStrap parameter.
      Returns:
      The specified error message or null, if the validation found no errors.