Class ISINValidator

  • All Implemented Interfaces:
    java.io.Serializable

    public class ISINValidator
    extends java.lang.Object
    implements java.io.Serializable
    ISIN (International Securities Identifying Number) validation.

    ISIN Numbers are 12 character alphanumeric codes used to identify Securities.

    ISINs consist of two alphabetic characters, which are the ISO 3166-1 alpha-2 code for the issuing country, nine alphanumeric characters (the National Securities Identifying Number, or NSIN, which identifies the security), and one numerical check digit. They are 12 characters in length.

    See Wikipedia - ISIN for more details.

    Since:
    1.7
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ISINValidator getInstance​(boolean checkCountryCode)
      Gets the singleton instance of the ISIN validator.
      boolean isValid​(java.lang.String code)
      Tests whether the code is a valid ISIN code after any transformation by the validate routine.
      java.lang.Object validate​(java.lang.String code)
      Checks the code is valid ISIN code.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static ISINValidator getInstance​(boolean checkCountryCode)
        Gets the singleton instance of the ISIN validator.
        Parameters:
        checkCountryCode - whether to check the country-code prefix or not
        Returns:
        A singleton instance of the appropriate ISIN validator.
      • isValid

        public boolean isValid​(java.lang.String code)
        Tests whether the code is a valid ISIN code after any transformation by the validate routine.
        Parameters:
        code - The code to validate.
        Returns:
        true if a valid ISIN code, otherwise false.
      • validate

        public java.lang.Object validate​(java.lang.String code)
        Checks the code is valid ISIN code.
        Parameters:
        code - The code to validate.
        Returns:
        A valid ISIN code if valid, otherwise null.