Java Class «ImplISMN» – Generate ISMN Barcode
- All Implemented Interfaces:
Cloneable
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.
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 Summary
Modifier and TypeMethodDescriptionvoid
setContent
(String content, boolean autoComplete, boolean appendOptionalChecksum) Sets the ISMN number to be encoded in the barcode.Methods inherited from class de.vwsoft.barcodelib4j.oned.LineageUPC
getAddOn, setAddOn
Methods inherited from class de.vwsoft.barcodelib4j.oned.Barcode
clone, draw, draw, getContent, getFont, getRatio, getText, getTextOffset, isFontSizeAdjusted, isOptionalChecksumVisible, isTextOnTop, isTextVisible, newInstance, newInstance, setFont, setFontSizeAdjusted, setOptionalChecksumVisible, setRatio, setTextOffset, setTextOnTop, setTextVisible, supportsAutoCompletion, supportsOptionalChecksum, supportsRatio
-
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 totrue
, the method calculates and appends the correct check digit; otherwise, aBarcodeException
is thrown.- Overrides:
setContent
in classImplEAN13
- Parameters:
content
- the ISMN number to be encodedautoComplete
- whether to automatically calculate the check digit if it is missingappendOptionalChecksum
- 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 ifautoComplete
isfalse
and the content is missing a check digit.
-