Barcode-Lib4J requires Java 9+

Java Class «ImplCode11»  –  Generate Code 11 Barcode

All Implemented Interfaces:
Cloneable

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

Code 11 is a numeric barcode format that encodes digits (0-9) and the hyphen (-). It is used primarily in telecommunications.

This class extends the abstract class LineageTwoWidth, as Code 11 is a type of two-width barcode. See the linked class description for more information.

Code 11 can be used with an optional checksum. Unlike most other barcode types, the checksum in Code 11 is composed of two characters.

  • Method Details

    • setContent

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

      If the appendOptionalChecksum parameter is set to true, the method will calculate and append a checksum to the content. The checksum consists of two characters.

      Specified by:
      setContent in class Barcode
      Parameters:
      content - the content to be encoded in the Code 11 barcode
      autoComplete - has no function in this method implementation
      appendOptionalChecksum - whether to append an optional checksum to the content
      Throws:
      BarcodeException - if the content is empty or contains invalid characters