Class AbstractTaxTinNumberValidator<A extends Annotation>
java.lang.Object
de.knightsoftnet.validators.shared.impl.AbstractTaxTinNumberValidator<A>
- All Implemented Interfaces:
jakarta.validation.ConstraintValidator<A,Object>
- Direct Known Subclasses:
TaxNumberValidator,TinValidator
public abstract class AbstractTaxTinNumberValidator<A extends Annotation>
extends Object
implements jakarta.validation.ConstraintValidator<A,Object>
Common Stuff from Tax and Tin Validator.
- Author:
- Manfred Tremmel
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckAtNumber(String number) check the Tax Number/Tax Identification Number, country version for Austria.protected booleancheck the Tax Identification Number number, country version for Denmark.protected booleancheck the Tax Identification Number number, country version for Estonia.protected booleancheck the Tax Identification Number number, country version for Spain.protected booleancheckModulo11(String number) check the Tax Identification Number number, default modulo 11.protected booleancheck the Tax Identification Number number, country version for Netherlands.protected booleancheck the Tax Identification Number number, country version for Poland.protected booleancheckUniqueMasterCitizenNumber(String number) check the Tax Identification Number number, country version for countries using unique master citizen number .protected static intsquareSum(int pvalue) calculate square sum.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.validation.ConstraintValidator
initialize, isValid
-
Field Details
-
MODULO_11
protected static final int MODULO_11modulo 11.- See Also:
-
message
error message key. -
fieldCountryCode
field name of the country code field. -
allowLowerCaseCountryCode
protected boolean allowLowerCaseCountryCodeare lower case country codes allowed (true/false).
-
-
Constructor Details
-
AbstractTaxTinNumberValidator
public AbstractTaxTinNumberValidator()
-
-
Method Details
-
checkAtNumber
check the Tax Number/Tax Identification Number, country version for Austria.- Parameters:
number- tax number/tax identification number to check- Returns:
- true if checksum is ok
-
checkDk
check the Tax Identification Number number, country version for Denmark.- Parameters:
number- vat id to check- Returns:
- true if checksum is ok
-
checkEe
check the Tax Identification Number number, country version for Estonia.- Parameters:
number- vat id to check- Returns:
- true if checksum is ok
-
checkEs
check the Tax Identification Number number, country version for Spain.- Parameters:
pnumber- vat id to check- Returns:
- true if checksum is ok
-
checkModulo11
check the Tax Identification Number number, default modulo 11.- Parameters:
number- vat id to check- Returns:
- true if checksum is ok
-
checkUniqueMasterCitizenNumber
check the Tax Identification Number number, country version for countries using unique master citizen number .- Parameters:
number- vat id to check- Returns:
- true if checksum is ok
-
checkNl
check the Tax Identification Number number, country version for Netherlands.- Parameters:
number- vat id to check- Returns:
- true if checksum is ok
-
checkPl
check the Tax Identification Number number, country version for Poland.- Parameters:
number- vat id to check- Returns:
- true if checksum is ok
-
squareSum
protected static int squareSum(int pvalue) calculate square sum.- Parameters:
pvalue- value to calculate square sum for- Returns:
- square sum
-