Package ninja.validation
Annotation Type Length
-
@Retention(RUNTIME) @Target(PARAMETER) public @interface Length
Validates that the length of the field meets the given length constraints- Author:
- James Roper
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description StringfieldKeyThe key for formatting the fieldintmaxThe maximum length of the fieldStringmaxKeyThe key max violation messageStringmaxMessageDefault message if max violation message isn't foundintminThe maximum length of the fieldStringminKeyThe key min violation messageStringminMessageDefault message if min violation message isn't found
-
-
-
-
maxKey
String maxKey
The key max violation message- Returns:
- The key of the max violation message
- Default:
- "validation.length.max.violation"
-
-
-
maxMessage
String maxMessage
Default message if max violation message isn't found- Returns:
- The default message
- Default:
- "{0} exceeds maximum length of {1}"
-
-
-
minKey
String minKey
The key min violation message- Returns:
- The key of the min violation message
- Default:
- "validation.length.min.violation"
-
-
-
minMessage
String minMessage
Default message if min violation message isn't found- Returns:
- The default message
- Default:
- "{0} is less than minimum length of {1}"
-
-
-
fieldKey
String fieldKey
The key for formatting the field- Returns:
- The key
- Default:
- ""
-
-