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 String
fieldKey
The key for formatting the fieldint
max
The maximum length of the fieldString
maxKey
The key max violation messageString
maxMessage
Default message if max violation message isn't foundint
min
The maximum length of the fieldString
minKey
The key min violation messageString
minMessage
Default 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:
- ""
-
-