Annotation Type CreditCardNumber
@Documented
@Constraint(validatedBy={})
@Target({METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE})
@Retention(RUNTIME)
@Repeatable(List.class)
@ReportAsSingleViolation
@LuhnCheck
public @interface CreditCardNumber
The annotated element has to represent a valid
credit card number. This is the Luhn algorithm implementation
which aims to check for user mistake, not credit card validity!
- Author:
- Hardy Ferentschik, Emmanuel Bernard
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic @interface
Defines several@CreditCardNumber
annotations on the same element. -
Optional Element Summary
-
Element Details
-
message
String message- Default:
- "{org.hibernate.validator.constraints.CreditCardNumber.message}"
-
groups
Class<?>[] groups- Default:
- {}
-
payload
- Default:
- {}
-
ignoreNonDigitCharacters
@OverridesAttribute(constraint=LuhnCheck.class, name="ignoreNonDigitCharacters") boolean ignoreNonDigitCharacters- Returns:
- Whether non-digit characters in the validated input should be ignored (
true
) or result in a validation error (false
). Default isfalse
- Default:
- false
-