Class IbanValidator

java.lang.Object
tools.pantheum.gaia.gs1.content.componentformat.IbanValidator
All Implemented Interfaces:
ComponentFormatInterface

public final class IbanValidator extends Object implements ComponentFormatInterface
Validates iban — International Bank Account Number.

Rules:

  • Length 5–34
  • Positions 1–2: ISO 3166-1 alpha-2 country code (two uppercase letters)
  • Positions 3–4: 2-digit check number
  • Positions 5–end: BBAN — uppercase letters and digits only
  • MOD-97 check digit verification (result must equal 1)
  • Field Details

    • INSTANCE

      public static final IbanValidator INSTANCE
      The singleton instance.
  • Method Details

    • validate

      public List<GaiaError> validate(String s, String ai, int position, String component, String format, GaiaConstants.Language language)
      Description copied from interface: ComponentFormatInterface
      Validates value against this format's rules and returns the resulting errors, or an empty list when valid (one GaiaError per failing condition).
      Specified by:
      validate in interface ComponentFormatInterface
      Parameters:
      s - the component slice to validate (charset already verified)
      ai - the Application Identifier of the enclosing element
      position - the character position of the element in the input
      component - the component's data title
      format - the component's format key
      language - the language in which to produce the error messages
      Returns:
      the validate.