Annotation Interface HvlNoWhitespace
@Target(FIELD)
@Retention(RUNTIME)
@Constraint(validatedBy=HvlNoWhitespaceValidator.class)
@Documented
public @interface HvlNoWhitespace
A validation annotation to ensure that a field does not contain any whitespace characters.
-
Optional Element Summary
-
Element Details
-
message
String messageReturns the error message to be used when validation fails.- Returns:
- the string
- Default:
"Value cannot contain spaces."
-
groups
Class<?>[] groupsReturns the validation groups to which this constraint belongs.- Returns:
- the class [ ]
- Default:
{}
-
payload
Class<? extends jakarta.validation.Payload>[] payloadReturns any additional payload objects associated with this constraint.- Returns:
- the class [ ]
- Default:
{}
-