public class HIBCLICCombinedCodetext extends HIBCLICComplexCodetext
Class for encoding and decoding the text embedded in the HIBC LIC code which stores primary and secodary data.
This sample shows how to encode and decode HIBC LIC using HIBCLICCombinedCodetext.HIBCLICCombinedCodetext combinedCodetext = new HIBCLICCombinedCodetext(); combinedCodetext.setBarcodeType(EncodeTypes.HIBCQRLIC); combinedCodetext.setPrimaryData(new PrimaryData()); combinedCodetext.getPrimaryData().setProductOrCatalogNumber("12345"); combinedCodetext.getPrimaryData().setLabelerIdentificationCode("A999"); combinedCodetext.getPrimaryData().setUnitOfMeasureID(1); combinedCodetext.setSecondaryAndAdditionalData(new SecondaryAndAdditionalData()); combinedCodetext.getSecondaryAndAdditionalData().setExpiryDate(new Date()); combinedCodetext.getSecondaryAndAdditionalData().setExpiryDateFormat(HIBCLICDateFormat.MMDDYY); combinedCodetext.getSecondaryAndAdditionalData().setQuantity(30); combinedCodetext.getSecondaryAndAdditionalData().setLotNumber("LOT123"); combinedCodetext.getSecondaryAndAdditionalData().setSerialNumber("SERIAL123"); combinedCodetext.getSecondaryAndAdditionalData().setDateOfManufacture(new Date()); ComplexBarcodeGenerator generator = new ComplexBarcodeGenerator(combinedCodetext); BufferedImage image = generator.generateBarCodeImage(); BarCodeReader reader = new BarCodeReader(image, DecodeType.HIBCQRLIC); reader.readBarCodes(); String codetext = reader.getFoundBarCodes()[0].getCodeText(); HIBCLICCombinedCodetext result = (HIBCLICCombinedCodetext)ComplexCodetextReader.tryDecodeHIBCLIC(codetext); System.out.println("Product or catalog number: " + result.getPrimaryData().getProductOrCatalogNumber()); System.out.println("Labeler identification code: " + result.getPrimaryData().getLabelerIdentificationCode()); System.out.println("Unit of measure ID: " + result.getPrimaryData().getUnitOfMeasureID()); System.out.println("Expiry date: " + result.getSecondaryAndAdditionalData().getExpiryDate()); System.out.println("Quantity: " + result.getSecondaryAndAdditionalData().getQuantity()); System.out.println("Lot number: " + result.getSecondaryAndAdditionalData().getLotNumber()); System.out.println("Serial number: " + result.getSecondaryAndAdditionalData().getSerialNumber()); System.out.println("Date of manufacture: " + result.getSecondaryAndAdditionalData().getDateOfManufacture());
| Constructor and Description |
|---|
HIBCLICCombinedCodetext() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Returns a value indicating whether this instance is equal to a specified
HIBCLICCombinedCodetext value. |
java.lang.String |
getConstructedCodetext()
Constructs codetext
|
PrimaryData |
getPrimaryData()
Identifies primary data.
|
SecondaryAndAdditionalData |
getSecondaryAndAdditionalData()
Identifies secondary and additional supplemental data.
|
int |
hashCode()
Returns the hash code for this instance.
|
void |
initFromString(java.lang.String constructedCodetext)
Initializes instance from constructed codetext.
|
void |
setPrimaryData(PrimaryData value)
Identifies primary data.
|
void |
setSecondaryAndAdditionalData(SecondaryAndAdditionalData value)
Identifies secondary and additional supplemental data.
|
getBarcodeType, setBarcodeTypepublic PrimaryData getPrimaryData()
Identifies primary data.
public void setPrimaryData(PrimaryData value)
Identifies primary data.
public SecondaryAndAdditionalData getSecondaryAndAdditionalData()
Identifies secondary and additional supplemental data.
public void setSecondaryAndAdditionalData(SecondaryAndAdditionalData value)
Identifies secondary and additional supplemental data.
public java.lang.String getConstructedCodetext()
Constructs codetext
getConstructedCodetext in interface IComplexCodetextgetConstructedCodetext in class HIBCLICComplexCodetextpublic void initFromString(java.lang.String constructedCodetext)
Initializes instance from constructed codetext.
initFromString in interface IComplexCodetextinitFromString in class HIBCLICComplexCodetextconstructedCodetext - Constructed codetext.public boolean equals(java.lang.Object obj)
Returns a value indicating whether this instance is equal to a specified HIBCLICCombinedCodetext value.
equals in class java.lang.Objectobj - An HIBCLICCombinedCodetext value to compare to this instance.<b>true</b> if obj has the same value as this instance; otherwise, <b>false</b>.public int hashCode()
Returns the hash code for this instance.
hashCode in class java.lang.Object