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
    Modifier and Type
    Field
    Description
    protected boolean
    are lower case country codes allowed (true/false).
    protected String
    field name of the country code field.
    protected String
    error message key.
    protected static final int
    modulo 11.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    check the Tax Number/Tax Identification Number, country version for Austria.
    protected boolean
    checkDk(String number)
    check the Tax Identification Number number, country version for Denmark.
    protected boolean
    checkEe(String number)
    check the Tax Identification Number number, country version for Estonia.
    protected boolean
    checkEs(String pnumber)
    check the Tax Identification Number number, country version for Spain.
    protected boolean
    check the Tax Identification Number number, default modulo 11.
    protected boolean
    checkNl(String number)
    check the Tax Identification Number number, country version for Netherlands.
    protected boolean
    checkPl(String number)
    check the Tax Identification Number number, country version for Poland.
    protected boolean
    check the Tax Identification Number number, country version for countries using unique master citizen number .
    protected static int
    squareSum(int pvalue)
    calculate square sum.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface jakarta.validation.ConstraintValidator

    initialize, isValid
  • Field Details

    • MODULO_11

      protected static final int MODULO_11
      modulo 11.
      See Also:
    • 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 Details

    • AbstractTaxTinNumberValidator

      public AbstractTaxTinNumberValidator()
  • Method Details

    • 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