Barcode-Lib4J requires Java 9+

Java Class «ImplISMN»  –  Generate ISMN Barcode

All Implemented Interfaces:
Cloneable

public class ImplISMN extends ImplEAN13
Implementation of ISMN (International Standard Music Number). To generate instances, please use one of the newInstance static methods in the Barcode class.

ISMN barcodes are based on the GTIN (Global Trade Item Number) system and use the EAN-13 barcode symbology (also known as GTIN-13). ISMN is primarily used for printed music and musical scores, ensuring accurate tracking and identification within the global trade system.

An ISMN number consists of the following components:

  • A prefix of "979" followed by a single digit "0" to indicate a musical work,
  • A publisher code,
  • An item number, and
  • A single check digit at the end.
The components are separated by hyphens, for example: 979-0-1234-5678-5.

Note: The human readable ISMN number is printed below the barcode without hyphens and above the barcode with hyphens. The latter instance is drawn outside the barcode's bounding box, which may require additional space and a downward shift of the Y-position.

  • Method Details

    • setContent

      public void setContent(String content, boolean autoComplete, boolean appendOptionalChecksum) throws BarcodeException
      Sets the ISMN number to be encoded in the barcode.

      The input must conform to the ISMN structure, consisting of only numeric characters and hyphens ('-'). The input must include a prefix, publisher, and item number. For example:

          979-0-1234-5678-5
      If the provided ISMN number contains a check digit (at the end), the method validates it according to ISMN rules.

      If the provided ISMN number does not contain a check digit and the autoComplete flag is set to true, the method calculates and appends the correct check digit; otherwise, a BarcodeException is thrown.

      Overrides:
      setContent in class ImplEAN13
      Parameters:
      content - the ISMN number to be encoded
      autoComplete - whether to automatically calculate the check digit if it is missing
      appendOptionalChecksum - has no function, as ISMN uses a fixed check digit which is not optional
      Throws:
      BarcodeException - if the content is empty, does not conform to the proper ISMN format, contains an invalid check digit, or if autoComplete is false and the content is missing a check digit.