Package com.jbstrap.core.validators
Class IntegerValidator
java.lang.Object
com.jbstrap.core.validators.IntegerValidator
- All Implemented Interfaces:
DataValidator
Integer validator class
- Since:
- 4.0
- Author:
- JBStrap
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvalidateData
(Object data, String language) Validates the specified data
-
Constructor Details
-
IntegerValidator
public IntegerValidator()
-
-
Method Details
-
validateData
Validates the specified data
The specified data is validated, if it can be converted into an Integer.
The error message can be customized with the
validator.floatValidatorError
properties file key. This is also used to implement language specific error messages. For more information about language specific messages, see:MessageSourceAPI
- Specified by:
validateData
in interfaceDataValidator
- Parameters:
data
- The data to be validatedlanguage
- The language code of the error message. If not specified, the default language will be used. The default language can be set with theDEFAULT_LANGUAGE
JBStrap parameter.- Returns:
- The specified error message or
null
, if the validation found no errors.
-