Package org.dellroad.stuff.validation
Annotation Interface HostOrIP
@Documented
@Constraint(validatedBy={})
@Target({METHOD,FIELD,ANNOTATION_TYPE})
@Retention(RUNTIME)
@Pattern(regexp="^((([\\p{Alnum}]([-\\p{Alnum}]*[\\p{Alnum}])?)\\.)+([\\p{Alpha}]([-\\p{Alnum}]*[\\p{Alnum}])?))|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))$")
@ReportAsSingleViolation
public @interface HostOrIP
Validation constraint requiring a
String
to be either a valid fully-qualified DNS hostname
or an IPv4 address.-
Optional Element Summary