org.hibernate.validator.constraints
Annotation Type URL
@Documented
@Constraint(validatedBy=URLValidator.class)
@Target(value={METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER})
@Retention(value=RUNTIME)
@Pattern(regexp="")
public @interface URL
Validate that the string is a valid URL.
- Author:
- Hardy Ferentschik
|
Optional Element Summary |
javax.validation.constraints.Pattern.Flag[] |
flags
|
java.lang.Class<?>[] |
groups
|
java.lang.String |
host
|
java.lang.String |
message
|
java.lang.Class<? extends javax.validation.Payload>[] |
payload
|
int |
port
|
java.lang.String |
protocol
|
java.lang.String |
regexp
|
message
public abstract java.lang.String message
- Default:
- "{org.hibernate.validator.constraints.URL.message}"
groups
public abstract java.lang.Class<?>[] groups
- Default:
- {}
payload
public abstract java.lang.Class<? extends javax.validation.Payload>[] payload
- Default:
- {}
protocol
public abstract java.lang.String protocol
- Returns:
- the protocol (scheme) the annotated string must match, eg ftp or http.
Per default any protocol is allowed
- Default:
- ""
host
public abstract java.lang.String host
- Returns:
- the host the annotated string must match, eg localhost. Per default any host is allowed
- Default:
- ""
port
public abstract int port
- Returns:
- the port the annotated string must match, eg 80. Per default any port is allowed
- Default:
- -1
regexp
public abstract java.lang.String regexp
- Returns:
- a regular expression the annotated must match. The default is any string ('.*')
- Default:
- ".*"
flags
public abstract javax.validation.constraints.Pattern.Flag[] flags
- Returns:
- used in combination with
regexp() in order to specify a regular expression option
- Default:
- {}
Copyright © 2011 Oracle Corporation. All Rights Reserved.