Class Code128Writer

All Implemented Interfaces:
Writer

public final class Code128Writer extends OneDimensionalCodeWriter
This object renders a CODE128 code as a BitMatrix.
Author:
erik.barbara@gmail.com (Erik Barbara)
  • Constructor Details

    • Code128Writer

      public Code128Writer()
  • Method Details

    • getSupportedWriteFormats

      protected Collection<BarcodeFormat> getSupportedWriteFormats()
      Overrides:
      getSupportedWriteFormats in class OneDimensionalCodeWriter
    • encode

      public boolean[] encode(String contents)
      Description copied from class: OneDimensionalCodeWriter
      Encode the contents to boolean array expression of one-dimensional barcode. Start code and end code should be included in result, and side margins should not be included.
      Specified by:
      encode in class OneDimensionalCodeWriter
      Parameters:
      contents - barcode contents to encode
      Returns:
      a boolean[] of horizontal pixels (false = white, true = black)
    • encode

      public boolean[] encode(String contents, Map<EncodeHintType,?> hints)
      Description copied from class: OneDimensionalCodeWriter
      Can be overwritten if the encode requires to read the hints map. Otherwise it defaults to encode.
      Overrides:
      encode in class OneDimensionalCodeWriter
      Parameters:
      contents - barcode contents to encode
      hints - encoding hints
      Returns:
      a boolean[] of horizontal pixels (false = white, true = black)