ConstraintDeclarationException class
Thrown when a constraint is declared wrongly: invalid settings
(Size(min: -1), min > max, a malformed regular expression),
@ConvertGroup without @Valid(), or @Each on a value that is not a
collection. Jakarta's ConstraintDeclarationException.
// @Size(min: 5, max: 2) String name = '';
validator.validateObject(form); // throws ConstraintDeclarationException
Spring (Java):
} catch (jakarta.validation.ConstraintDeclarationException e) { ... }
- Inheritance
-
- Object
- ValidationException
- ConstraintDeclarationException
- Implementers
Constructors
- ConstraintDeclarationException(String message)
-
An exception explaining the wrong declaration in
message.const
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited