Barcode-Lib4J requires Java 9+

Java Class «ImplCodabar»  –  Generate Codabar Barcode

All Implemented Interfaces:
Cloneable

public class ImplCodabar extends LineageTwoWidth
Implementation of Codabar. To generate instances, please use one of the newInstance static methods in the Barcode class.

Codabar is a 1D barcode symbology typically used in libraries, blood banks and transportation applications. It is capable of encoding digits (0-9) and the characters plus (+), minus (-), dollar ($), colon (:), slash (/), and period (.), as well as the start/stop characters 'A', 'B', 'C' and 'D'.

The encoded data must begin and end with one of the above start/stop characters. These characters can be either different or the same.

  • Method Details

    • setContent

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

      Validates the provided content and ensures that it begins and ends with a valid start/stop character ('A', 'B', 'C' or 'D'). If autoComplete is set to true, the method will automatically add 'A' as the start and stop character if one or both are missing.

      Specified by:
      setContent in class Barcode
      Parameters:
      content - the content to be encoded in the Codabar barcode
      autoComplete - whether to automatically add start and stop characters if they are missing
      appendOptionalChecksum - has no function, as Codabar does not support checksums
      Throws:
      BarcodeException - if the content is empty, invalid, or missing required start/stop characters