Class AbstractTaxTinNumberValidator<A extends Annotation>
- java.lang.Object
-
- de.knightsoftnet.validators.shared.impl.AbstractTaxTinNumberValidator<A>
-
- All Implemented Interfaces:
javax.validation.ConstraintValidator<A,Object>
- Direct Known Subclasses:
TaxNumberValidator,TinValidator
public abstract class AbstractTaxTinNumberValidator<A extends Annotation> extends Object implements javax.validation.ConstraintValidator<A,Object>
Common Stuff from Tax and Tin Validator.- Author:
- Manfred Tremmel
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanallowLowerCaseCountryCodeare lower case country codes allowed (true/false).protected StringfieldCountryCodefield name of the country code field.protected Stringmessageerror message key.protected static intMODULO_11modulo 11.
-
Constructor Summary
Constructors Constructor Description AbstractTaxTinNumberValidator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancheckAtNumber(String number)check the Tax Number/Tax Identification Number, country version for Austria.protected booleancheckDk(String number)check the Tax Identification Number number, country version for Denmark.protected booleancheckEe(String number)check the Tax Identification Number number, country version for Estonia.protected booleancheckEs(String pnumber)check the Tax Identification Number number, country version for Spain.protected booleancheckModulo11(String number)check the Tax Identification Number number, default modulo 11.protected booleancheckNl(String number)check the Tax Identification Number number, country version for Netherlands.protected booleancheckPl(String number)check 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.
-
-
-
Field Detail
-
MODULO_11
protected static final int MODULO_11
modulo 11.- See Also:
- Constant Field Values
-
message
protected String message
error message key.
-
fieldCountryCode
protected String fieldCountryCode
field name of the country code field.
-
allowLowerCaseCountryCode
protected boolean allowLowerCaseCountryCode
are lower case country codes allowed (true/false).
-
-
Method Detail
-
checkAtNumber
protected boolean checkAtNumber(String number)
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
protected boolean checkDk(String number)
check the Tax Identification Number number, country version for Denmark.- Parameters:
number- vat id to check- Returns:
- true if checksum is ok
-
checkEe
protected boolean checkEe(String number)
check the Tax Identification Number number, country version for Estonia.- Parameters:
number- vat id to check- Returns:
- true if checksum is ok
-
checkEs
protected boolean checkEs(String pnumber)
check the Tax Identification Number number, country version for Spain.- Parameters:
pnumber- vat id to check- Returns:
- true if checksum is ok
-
checkModulo11
protected boolean checkModulo11(String number)
check the Tax Identification Number number, default modulo 11.- Parameters:
number- vat id to check- Returns:
- true if checksum is ok
-
checkUniqueMasterCitizenNumber
protected boolean checkUniqueMasterCitizenNumber(String number)
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
protected boolean checkNl(String number)
check the Tax Identification Number number, country version for Netherlands.- Parameters:
number- vat id to check- Returns:
- true if checksum is ok
-
checkPl
protected boolean checkPl(String number)
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
-
-