Package com.codename1.backend.validation
package com.codename1.backend.validation
Build-time checked constraints on controller input.
Put Valid on a @RequestBody or @ModelAttribute parameter, or a
constraint such as NotBlank, Size, Min or Max directly on a
@RequestParam, @PathVariable or @RequestHeader parameter, and the
generated router checks it before the controller method runs. A failure is a
ValidationException carrying a FieldError per broken constraint, with a
stable path for each.
The checks are generated Java, not reflection, so they cost what a
hand-written if costs and survive translation. Regular expressions are not
among the constraints, because the backend's class library has none; check
such a value in the method and throw a ValidationException yourself.
-
ClassDescriptionOne constraint one value broke.A
Stringor otherCharSequencethat must hold at least one character that is not whitespace.ACharSequence, collection, map or array that must hold at least one element.The value must not be null.The length of aCharSequence, or the size of a collection, map or array, must lie betweenSize.min()andSize.max(), inclusive.Validates the annotated value's own constraints.A request whose input broke its declared constraints.Collects theFieldErrors of one request.