MaxiCodeStructuredCodetext
Source: ComplexBarcode.
Base class for encoding and decoding the text embedded in the MaxiCode code for modes 2 and 3.
This sample shows how to decode raw MaxiCode codetext to MaxiCodeStructuredCodetext instance.
new MaxiCodeStructuredCodetext()
Example
let reader = new BarCodeReader("c:\\test.png", null, DecodeType.MAXI_CODE);
reader.readBarCodes().forEach(function(result, i, results)
{
let resultMaxiCodeCodetext = ComplexCodetextReader.tryDecodeMaxiCode(result.getExtended().getMaxiCode().getMaxiCodeMode(), result.getCodeText());
if (resultMaxiCodeCodetext instanceof MaxiCodeStructuredCodetext)
{
let maxiCodeStructuredCodetext = resultMaxiCodeCodetext;
console.log("BarCode Type: " + maxiCodeStructuredCodetext.getPostalCode());
console.log("MaxiCode mode: " + maxiCodeStructuredCodetext.getCountryCode());
console.log("BarCode CodeText: " + maxiCodeStructuredCodetext.getServiceCategory());
}
});
Methods
equals(obj)
Returns a value indicating whether this instance is equal to a specified
Parameter
Name | Type | Optional | Description |
---|---|---|---|
obj |
|
|
An
|
- Returns
-
true if obj has the same value as this instance; otherwise, false
getConstructedCodetext()
Constructs codetext
- Returns
-
Constructed codetext
getCountryCode()
Identifies 3 digit country code.
getHashCode()
Returns the hash code for this instance.
- Returns
-
A 32-bit signed integer hash code.
getPostalCode()
Identifies the postal code. Must be 9 digits in mode 2 or 6 alphanumeric symbols in mode 3.
getSecondMessage()
Identifies second message of the barcode.
getServiceCategory()
Identifies 3 digit service category.
initFromString(constructedCodetext)
Initializes instance from constructed codetext.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
constructedCodetext |
|
|
Constructed codetext. |
setCountryCode()
Identifies 3 digit country code.
setSecondMessage()
Identifies second message of the barcode.
setServiceCategory()
Identifies 3 digit service category.