validations library

Classes

After
Checks whether the annotated date is after the specified date.
AfterValidator
Checks whether the give value is after the specified time and date. [...]
Alpha
Checks that the annotated string contains only alpha characters A-z.
AlphaNumericValidator
Checks whether the value contains of only alphanumeric characters. [...]
AlphaValidator
Checks whether the value contains of only alpha characters. [...]
AsciiValidator
Checks whether the value contains of only ascii characters. [...]
Base64Validator
Checks whether the value is valid base64 encoding. [...]
Before
Checks whether the annotated date is before the specified date.
BeforeValidator
Checks whether the give value is before the specified time and date. [...]
Blank
Checks that the annotated string is null or the length is not greater than 0.
BlankValidator
Check that a String is empty. A null value is considered valid.
ByteLengthValidator
Checks whether the value has a byte length between $min and $max. [...]
ClassConstraintValidator<ValueType>
ClassValidator<T>
Constraint
ConstraintValidator<ValueType>
All validator classes must either extend this class or the ConstraintValidatorContainer class. [...]
ConstraintValidatorContainer
ConstraintViolation<T>
ContainerAnnotation
CreditCardNumber
Checks that the annotated string passes the Luhn checksum test.
CreditCardNumberValidator
Checks whether the value is a valid credit card number. [...]
DateTimeBaseValidator
DecimalMax
Checks whether the annotated value is less than the specified maximum, when inclusive=false. Otherwise whether the value is less than or equal to the specified maximum. The parameter value is the string representation of the max value.
DecimalMaxValidator
Check that the value being validated represents a Decimal number. and has a value less than or equal to the maximum value specified. [...]
DecimalMin
Checks whether the annotated value is larger than the specified minimum, when inclusive=false. Otherwise whether the value is larger than or equal to the specified minimum. The parameter value is the string representation of the min value.
DecimalMinValidator
Check that the value being validated represents a Decimal number. and has a value greater than or equal to the maximum value specified. [...]
Digits
Checks whether the annotated value is a number having up to integer digits and fraction fractional digits.
DigitsValidator
Checks that the Decimal value being validated matches the integer and fraction lengths. [...]
DivisibleBy
Checks whether the annotated value is divisible by the specified value.
DivisibleByValidator
Checks whether the provided number is divisible by value. [...]
DurationMax
Checks that annotated Duration element is not greater than the one constructed from annotation parameters. Equality is allowed if inclusive flag is set to true.
DurationMaxValidator
Checks whether the Duration value does not last longer than the duration specified. [...]
DurationMin
Checks that annotated Duration element is not less than the one constructed from annotation parameters. Equality is allowed if inclusive flag is set to true.
DurationMinValidator
Checks whether the Duration value is not shorter than the duration specified. [...]
Email
Checks whether the specified string is a valid email address.
EmailValidator
Checks whether the value is a valid email address. [...]
EqualTo
Checks whether the annotated value is equal to another value.
EqualToValidator
Checks whether the value is equal to the value being tested. [...]
FieldMatch
FieldMatchValidator<ValueType>
Check that the baseField matches the matchField. [...]
FieldValidator<T>
FqdnValidator
Checks whether the value is a valid fully qualified domain name. [...]
FutureOrPresent
Checks whether the annotated date is in the present or in the future
FutureOrPresentValidator
Checks whether the value being checked is within the future or present. [...]
GenValidator
GreaterThan
Checks whether the annotated value is higher than the specified value.
GreaterThanOrEqual
Checks whether the annotated value is higher than or equal to the specified minimum.
GreaterThanOrEqualValidator
Checks if the value being tested is greater than or equal to value. [...]
GreaterThanValidator
Checks if the value being tested is greater than value. [...]
Hexadecimal
Checks that the annotated string is a valid hexadecimal.
HexadecimalValidator
Checks if the value is a valid hexadecimal. [...]
HexColor
Checks that the annotated string is a valid hex color.
HexColorValidator
Checks if the value is a valid hex color. [...]
IdenticalTo
Checks whether the annotated value is identical to another value.
IdenticalToValidator
Checks whether the value being tested is identical to value [...]
InFuture
Checks whether the annotated date is in the future
InFutureValidator
Checks whether the value being checked is within the future. [...]
IpValidator
Checks if the value is a valid ip address. [...]
ISBN
Checks that the annotated string is a valid ISBN. type determines the type of ISBN. The default is ISBN-13.
ISBNValidator
Checks if the value is a valid ISBN number. [...]
IsEmpty
Checks whether the annotated element is empty or null
IsEmptyValidator
Check that a value is empty. [...]
IsFalse
The annotated element must be false or null
IsFalseValidator
Check that the validated value is false. [...]
IsTrue
The annotated element must be true
IsTrueValidator
Check that the validated value is true. [...]
Json
Checks that the annotated string is valid JSON.
JsonValidator
Checks if the value is a valid JSON string. [...]
LessThan
Checks whether the annotated value is less than the specified value.
LessThanOrEqual
Checks whether the annotated value is less than or equal to the specified maximum.
LessThanOrEqualValidator
Checks if the value being tested is less than or equal to value. [...]
LessThanValidator
Checks if the value being tested is less than value. [...]
Lowercase
Checks that the annotated string is in lowercase.
LowercaseValidator
Checks if the value is in all lowercase. [...]
Max
Checks whether the annotated value is less than or equal to the specified maximum.
MaxValidator
Checks if the value being tested is less than or equal to value. [...]
Min
Checks whether the annotated value is higher than or equal to the specified minimum.
MinValidator
Checks if the value being tested is greater than or equal to value. [...]
MongoId
Checks that the annotated string is a valid mongo id.
MongoIdValidator
Checks if the value is a valid mongo id. [...]
Negative
Checks if the element is strictly negative. Zero values are considered invalid.
NegativeOrZero
Checks if the element is negative or zero.
NegativeOrZeroValidator
Checks whether the value is negative or zero. [...]
NegativeValidator
Checks whether the value is negative. [...]
Node
NotBlank
Checks that the annotated string is not null and the trimmed length is greater than 0.
NotBlankValidator
Check that a String is not null nor empty after removing any leading or trailing whitespace.
NotEmpty
Checks whether the annotated element is not null nor empty
NotEmptyValidator
Check that a value is not empty and not null. [...]
NotEqualTo
Checks whether the annotated value is not equal to another value.
NotEqualToValidator
Checks whether the value is not equal to the value being tested. [...]
NotIdenticalTo
Checks whether the annotated value is not identical to another value.
NotIdenticalToValidator
Checks whether the value being tested is not identical to value [...]
NotNull
Checks whether the annotated element is not null
NotNullValidator
Check that a value is not null.
Null
Checks whether the annotated element is null
NullValidator
Check that a value is null.
Numeric
Checks that the annotated string is a valid number.
NumericValidator
Checks
Past
Checks whether the annotated date is in the past
PastOrPresent
Checks whether the annotated date is in the past or in the present
PastOrPresentValidator
Checks whether the value being checked is within the past or present. [...]
PastValidator
Checks whether the value being checked is within the past. [...]
Pattern
Checks if the annotated string matches the regular expression RegExp pattern.
PatternValidator
Positive
Checks if the element is strictly positive. Zero values are considered invalid.
PositiveOrZero
Checks if the element is positive or zero.
PositiveOrZeroValidator
Checks whether the value is positive or zero. [...]
PositiveValidator
Checks whether the value is positive. [...]
PropertyMap<ValueType>
Range
Checks whether the annotated value lies between (inclusive) the specified minimum and maximum
RangeValidator
Check that a given object is between some minimum and maximum. [...]
Size
Checks if the annotated element’s size is between min and max (inclusive)
SizeValidator
Checks that the length or value is between min and max. [...]
Target
TimeUnitBaseValidator
Type
Checks whether the annotated element is of the declared type
TypeValidator<T>
Unique
Checks that the annotated collection only contains unique elements. The default message does not include the list of duplicate elements but you can include it by overriding the message and using the {duplicates} message parameter. The list of duplicate elements is also included in the dynamic payload of the constraint violation.
UniqueValidator
Validates that the provided collection only contains unique items. [...]
Uppercase
Checks that the annotated string is uppercase.
UppercaseValidator
Checks if the value is in all uppercase. [...]
URL
Checks if the annotated string is a valid URL according to RFC2396. If any of the optional parameters protocol, host or port are specified, the corresponding URL fragments must match the specified values. The optional parameter regexp allow to specify an additional regular expression which the URL must match.
UrlValidator
Checks whether the value is a valid url. [...]
Uuid
Checks that the annotated string is a UUID. [...]
UuidValidator
Checks whether the value is a valid UUID. [...]
Valid
Checks that the annotated Type is valid. [...]
ValidationContext
Validator<T>
This is the base validator class. [...]
ValidatorAnnotation
ValidatorMixin<T extends Validator>
Enables a validator to be used as a mixin. [...]
ValidValidator
Checks whether the validated object is valid. [...]
ValueContext

Constants

alpha → const Alpha
Alpha annotation using default values
const Alpha()
blank → const Blank
Blank annotation using default values
const Blank()
creditCardNumber → const CreditCardNumber
CreditCardNumber annotation using default values
email → const Email
Email annotation using default values
const Email()
errorMessage → const _ErrorMessage
Used to mark a errorMessage field in a class level annotation [...]
const _ErrorMessage()
future → const InFuture
InFuture annotation using default values
const InFuture()
futureOrPresent → const FutureOrPresent
FutureOrPresent annotation using default values
const FutureOrPresent()
hexadecimal → const Hexadecimal
Hexadecimal annotation using default values
const Hexadecimal()
hexcolor → const HexColor
HexColor annotation using default values
const HexColor()
isbn → const ISBN
ISBN annotation using default values
const ISBN()
isEmpty → const IsEmpty
IsEmpty annotation using default values
const IsEmpty()
isFalse → const IsFalse
IsFalse annotation using default values
const IsFalse()
isNull → const Null
Null annotation using default values
const Null()
isTrue → const IsTrue
IsTrue annotation using default values
const IsTrue()
json → const Json
Json annotation using default values
const Json()
lowercase → const Lowercase
Lowercase annotation using default values
const Lowercase()
maxFraction → const int
20
mixedAnnotations → const List<Type>
const [Digits, Size]
mongoId → const MongoId
MongoId annotation using default values
const MongoId()
negative → const Negative
Negative annotation using default values
const Negative()
negativeOrZero → const NegativeOrZero
NegativeOrZero annotation using default values
const NegativeOrZero()
notBlank → const NotBlank
NotBlank annotation using default values
const NotBlank()
notEmpty → const NotEmpty
NotEmpty annotation using default values
const NotEmpty()
notNull → const NotNull
NotNull annotation using default values
const NotNull()
numeric → const Numeric
Numeric annotation using default values
const Numeric()
past → const Past
Past annotation using default values
const Past()
pastOrPresent → const PastOrPresent
PastOrPresent annotation using default values
const PastOrPresent()
positive → const Positive
Positive annotation using default values
const Positive()
positiveOrZero → const PositiveOrZero
PositiveOrZero annotation using default values
const PositiveOrZero()
property → const _Property
Used to mark the value of a parameter in a class level annotation as being a property of the validated class. [...]
const _Property()
timeUnits → const List<String>
const ['year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond', 'microsecond']
unique → const Unique
Unique annotation using default values
const Unique()
uppercase → const Uppercase
Uppercase annotation using default values
const Uppercase()
url → const URL
URL annotation using default values
const URL()
uuid → const Uuid
Uuid annotation using default values
const Uuid()
valid → const Valid
Valid annotation using default values
const Valid()

Properties

basicAnnotations → List<Object>
final
basicValidators → List<Type>
final
choiceAnnotations → List
final
classLevelAnnotations → List<Type>
final
classLevelValidators → List<Type>
final
collectionAnnotations → List<Object>
final
collectionValidators → List<Type>
final
comparisonAnnotations → List<Type>
final
comparisonValidators → List<Type>
final
dateAnnotations → List<Object>
final
dateValidators → List<Type>
final
fieldAnnotations → List
final
fileAnnotations → List
final
mixedValidators → List<Type>
final
moneyAnnotations → List
final
numberAnnotations → List<Object>
final
numberValidators → List<Type>
final
stringAnnotations → List<Object>
final
stringValidators → List<Type>
final
validators → List<List<Type>>
final

Enums

ElementType
TimeUnit
ValidationMode

Typedefs

ValidationMethod() → Set<ConstraintViolation>