Annotation Type IPAddress
@Documented @Retention(RUNTIME) @Target({METHOD,FIELD,PARAMETER,TYPE_USE}) @Constraint(validatedBy=Validator.class) public @interface IPAddress
Validates that a string looks like an IP address. A string is considered to
be a valid IP address if it looks like a dotted quad.
- Author:
- Donal Fellows
-
Element Details
-
nullOK
boolean nullOKWhethernull
is allowed. It defaults to being disallowed.- Returns:
- Whether to accept
null
.
- Default:
- false
-
emptyOK
boolean emptyOKWhether the empty string is allowed. It defaults to being disallowed.- Returns:
- Whether to accept the empty string.
- Default:
- false
-
message
String messageMessage on constraint violated.- Returns:
- Message
- Default:
- "\'${validatedValue}\' is a bad IPv4 address"
-