Package org.sonar.sslr.toolkit
Class Validators
- java.lang.Object
-
- org.sonar.sslr.toolkit.Validators
-
public class Validators extends Object
Provides a few handy configuration property validators out-of-the-box.- Since:
- 1.17
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ValidationCallbackbooleanValidator()Validates that the property holds a boolean value, i.e.static ValidationCallbackcharsetValidator()Validates that the property holds a validCharsetname.static ValidationCallbackintegerRangeValidator(int lowerBound, int upperBound)Validates that the property holds an integer within the given lower and upper bounds.
-
-
-
Method Detail
-
charsetValidator
public static ValidationCallback charsetValidator()
Validates that the property holds a validCharsetname.- Returns:
- A charset validator
-
integerRangeValidator
public static ValidationCallback integerRangeValidator(int lowerBound, int upperBound)
Validates that the property holds an integer within the given lower and upper bounds.- Parameters:
lowerBound-upperBound-- Returns:
- An integer range validator
-
booleanValidator
public static ValidationCallback booleanValidator()
Validates that the property holds a boolean value, i.e. either "true" or "false".- Returns:
- A boolean validator
-
-