Class AbstractTaxTinNumberValidator<A extends Annotation>

  • 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 Detail

      • 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).
    • Constructor Detail

      • AbstractTaxTinNumberValidator

        public AbstractTaxTinNumberValidator()
    • 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