Barcode-Lib4J requires Java 11+
Package de.vwsoft.barcodelib4j.oned
Java Class «ImplCode11» – Barcode «Code 11»
java.lang.Object
de.vwsoft.barcodelib4j.oned.Barcode
de.vwsoft.barcodelib4j.oned.ImplCode11
- All Implemented Interfaces:
Cloneable
Implementation of Code 11. To create instances, 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.
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 Summary
Modifier and TypeMethodDescriptionvoid
setContent
(String content, boolean autoComplete, boolean appendOptionalChecksum) Sets the content to be encoded in the barcode.Methods inherited from class de.vwsoft.barcodelib4j.oned.Barcode
clone, draw, draw, draw, getAddOn, getContent, getFont, getRatio, getText, getTextOffset, isFontSizeAdjusted, isTextOnTop, isTextVisible, newInstance, newInstance, setAddOn, setCustomText, setFont, setFontSizeAdjusted, setRatio, setTextOffset, setTextOnTop, setTextVisible, supportsAddOn, supportsCustomText, supportsTextOnTop
-
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 totrue
, the method will calculate and append a checksum to the content. The checksum consists of two characters.- Specified by:
setContent
in classBarcode
- Parameters:
content
- the content to be encoded in the Code 11 barcodeautoComplete
- has no function in this method implementationappendOptionalChecksum
- whether to append an optional checksum to the content- Throws:
BarcodeException
- if the content is empty or contains invalid characters
-