Barcode-Lib4J requires Java 9+

Java Class «ImplCode128A»  –  Generate Code 128 A Barcode

All Implemented Interfaces:
Cloneable

public class ImplCode128A extends ImplCode128
Implementation of Code 128 A. To generate instances, please use one of the newInstance static methods in the Barcode class.

Code 128 A is a subset of Code 128, capable of encoding ASCII characters with values from 0 to 95, covering:

  • Control characters (ASCII 0-31), such as NUL, SOH, STX, etc.
  • Digits (0-9)
  • Upper case letters (A-Z)
  • Space character
  • Punctuation and special characters: !"#$%&'()*+,-./:;<=>?@[\]^_
In addition, Function Codes (FNC1 to FNC4) can be used within the provided input to meet specific application requirements.

Code 128 A uses an internal checksum included within the barcode symbol but not displayed in plaintext representation.

  • 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 to ensure that it contains only ASCII characters with values between 0 and 95, and throws a BarcodeException if it does not.

      The provided content can also include Function Codes FNC1 to FNC4 for specific application needs.

      Overrides:
      setContent in class ImplCode128
      Parameters:
      content - the content to be encoded in the Code 128 A barcode
      autoComplete - whether to automatically convert lowercase letters in the content to uppercase letters
      appendOptionalChecksum - has no function, as Code 128 A uses a fixed internal checksum which is not optional
      Throws:
      BarcodeException - if the content is empty, or contains characters outside ASCII range 0-95