Annotation Type TaxNumber
@Documented
@Constraint(validatedBy=TaxNumberValidator.class)
@Target({TYPE,ANNOTATION_TYPE})
@Retention(RUNTIME)
public @interface TaxNumber
The annotated bean must contain two properties:
Supported types are beans,
If
- country code (option
fieldCountryCode) - tax number (option
fieldTaxNumber)
Supported types are beans,
null elements are considered valid.If
allowLowerCaseCountryCode is set to true, lower case country codes are accepted.- Author:
- Manfred Tremmel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceDefines several@TaxNumberannotations on the same element. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanare lower case country codes allowed (true/false).booleanconvert old tax numbers before validating (true/false).field name of the country code field.field name of the postal code field.field name of the vat id field.Class<?>[]groups to use.localized message.Class<? extends jakarta.validation.Payload>[]payload whatever.
-
Element Details
-
message
String messagelocalized message.- Returns:
- localized validation message
- Default:
- "{de.knightsoftnet.validators.shared.TaxNumber.message}"
-
groups
Class<?>[] groupsgroups to use.- Returns:
- array of validation groups
- Default:
- {}
-
payload
Class<? extends jakarta.validation.Payload>[] payloadpayload whatever.- Returns:
- payload class
- Default:
- {}
-
fieldCountryCode
String fieldCountryCodefield name of the country code field.- Returns:
- field/path contains country code
- Default:
- "countryCode"
-
fieldPostalCode
String fieldPostalCodefield name of the postal code field.- Returns:
- field/path contains postal code
- Default:
- "postalCode"
-
allowLowerCaseCountryCode
boolean allowLowerCaseCountryCodeare lower case country codes allowed (true/false).- Returns:
- true if lower case country code is allowed
- Default:
- false
-
convertOldNumbers
boolean convertOldNumbersconvert old tax numbers before validating (true/false).- Returns:
- true if old tax numbers are converted to new ones
- Default:
- false
-
fieldTaxNumber
String fieldTaxNumberfield name of the vat id field.- Returns:
- field/path contains tax number
- Default:
- "taxNumber"
-