MaxiCodeCodetextMode3
Inheritance: java.lang.Object, com.aspose.barcode.complexbarcode.MaxiCodeCodetext, com.aspose.barcode.complexbarcode.MaxiCodeStructuredCodetext
public class MaxiCodeCodetextMode3 extends MaxiCodeStructuredCodetext
Class for encoding and decoding the text embedded in the MaxiCode code for modes 3. This sample shows how to encode and decode MaxiCode codetext for mode 3.
//Mode 3 with standart second message
MaxiCodeCodetextMode3 maxiCodeCodetext = new MaxiCodeCodetextMode3();
maxiCodeCodetext.setPostalCode("B1050");
maxiCodeCodetext.setCountryCode(056);
maxiCodeCodetext.setServiceCategory(999);
MaxiCodeStandartSecondMessage maxiCodeStandartSecondMessage = new MaxiCodeStandartSecondMessage();
maxiCodeStandartSecondMessage.setMessage("Test message");
maxiCodeCodetext.setSecondMessage(maxiCodeStandartSecondMessage);
ComplexBarcodeGenerator complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext);
complexGenerator.generateBarCodeImage();
//Mode 3 with structured second message
MaxiCodeCodetextMode3 maxiCodeCodetext = new MaxiCodeCodetextMode3();
maxiCodeCodetext.setPostalCode("B1050");
maxiCodeCodetext.setCountryCode(056);
maxiCodeCodetext.setServiceCategory(999);
MaxiCodeStructuredSecondMessage maxiCodeStructuredSecondMessage = new MaxiCodeStructuredSecondMessage();
maxiCodeStructuredSecondMessage.add("634 ALPHA DRIVE");
maxiCodeStructuredSecondMessage.add("PITTSBURGH");
maxiCodeStructuredSecondMessage.add("PA");
maxiCodeStructuredSecondMessage.setYear(99);
maxiCodeCodetext.setSecondMessage(maxiCodeStructuredSecondMessage);
ComplexBarcodeGenerator complexGenerator = new ComplexBarcodeGenerator(maxiCodeCodetext);
complexGenerator.generateBarCodeImage();
//Decoding raw codetext with standart second message
BarCodeReader reader = new BarCodeReader("c:\\test.png", DecodeType.MAXI_CODE);
for(BarCodeResult result : reader.readBarCodes())
{
MaxiCodeCodetext resultMaxiCodeCodetext = ComplexCodetextReader.tryDecodeMaxiCode(result.getExtended().getMaxiCode().getMaxiCodeMode(), result.getCodeText());
if (resultMaxiCodeCodetext instanceOf MaxiCodeCodetextMode3)
{
MaxiCodeCodetextMode3 maxiCodeStructuredCodetext = (MaxiCodeCodetextMode3)resultMaxiCodeCodetext;
System.out.println("BarCode Type: " + maxiCodeStructuredCodetext.getPostalCode());
System.out.println("MaxiCode mode: " + maxiCodeStructuredCodetext.getCountryCode());
System.out.println("BarCode CodeText: " + maxiCodeStructuredCodetext.getServiceCategory());
if (maxiCodeStructuredCodetext.getSecondMessage() instanceOf MaxiCodeStandartSecondMessage)
{
MaxiCodeStandartSecondMessage secondMessage = (MaxiCodeStandartSecondMessage)maxiCodeStructuredCodetext.getSecondMessage();
System.out.println("Message: " + secondMessage.getMessage());
}
}
}
//Decoding raw codetext with structured second message
BarCodeReader reader = new BarCodeReader("c:\\test.png", DecodeType.MAXI_CODE);
for(BarCodeResult result : reader.readBarCodes())
{
MaxiCodeCodetext resultMaxiCodeCodetext = ComplexCodetextReader.tryDecodeMaxiCode(result.getExtended().getMaxiCode().getMaxiCodeMode(), result.getCodeText());
if (resultMaxiCodeCodetext instanceOf MaxiCodeCodetextMode3)
{
MaxiCodeCodetextMode3 maxiCodeStructuredCodetext = (MaxiCodeCodetextMode3)resultMaxiCodeCodetext;
System.out.println("BarCode Type: " + maxiCodeStructuredCodetext.getPostalCode());
System.out.println("MaxiCode mode: " + maxiCodeStructuredCodetext.getCountryCode());
System.out.println("BarCode CodeText: " + maxiCodeStructuredCodetext.getServiceCategory());
if (maxiCodeStructuredCodetext.getSecondMessage() instanceOf MaxiCodeStructuredSecondMessage)
{
MaxiCodeStructuredSecondMessage secondMessage = (MaxiCodeStructuredSecondMessage)maxiCodeStructuredCodetext.getSecondMessage();
System.out.println("Message:");
for(String identifier : secondMessage.getIdentifiers())
{
System.out.println(identifier);
}
}
}
}
Constructors
| Constructor | Description |
|---|---|
| MaxiCodeCodetextMode3() |
Methods
| Method | Description |
|---|---|
| equals(Object obj) | Returns a value indicating whether this instance is equal to a specified MaxiCodeStructuredCodetext value. |
| getBarcodeType() | Gets barcode type. |
| getClass() | |
| getConstructedCodetext() | Constructs codetext |
| getCountryCode() | Identifies 3 digit country code. |
| getECIEncoding() | Gets ECI encoding. |
| getEncodeMode() | Gets a MaxiCode encode mode. |
| getMaxiCodeEncodeMode() | Gets a MaxiCode encode mode. |
| getMode() | Gets MaxiCode mode. |
| getPostalCode() | Identifies the postal code. |
| getSecondMessage() | Identifies second message of the barcode. |
| getServiceCategory() | Identifies 3 digit service category. |
| hashCode() | Returns the hash code for this instance. |
| initFromString(String constructedCodetext) | Initializes instance from constructed codetext. |
| notify() | |
| notifyAll() | |
| setCountryCode(int value) | Identifies 3 digit country code. |
| setECIEncoding(int value) | Sets ECI encoding. |
| setEncodeMode(MaxiCodeEncodeMode value) | Sets a MaxiCode encode mode. |
| setMaxiCodeEncodeMode(MaxiCodeEncodeMode value) | Sets a MaxiCode encode mode. |
| setPostalCode(String value) | Identifies the postal code. |
| setSecondMessage(MaxiCodeSecondMessage value) | Identifies second message of the barcode. |
| setServiceCategory(int value) | Identifies 3 digit service category. |
| toString() | |
| wait() | |
| wait(long arg0) | |
| wait(long arg0, int arg1) |
MaxiCodeCodetextMode3()
public MaxiCodeCodetextMode3()
equals(Object obj)
public boolean equals(Object obj)
Returns a value indicating whether this instance is equal to a specified MaxiCodeStructuredCodetext value.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| obj | java.lang.Object | An MaxiCodeStructuredCodetext value to compare to this instance |
Returns: boolean - true if obj has the same value as this instance; otherwise, false
getBarcodeType()
public final BaseEncodeType getBarcodeType()
Gets barcode type.
Returns: BaseEncodeType - Barcode type.
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getConstructedCodetext()
public String getConstructedCodetext()
Constructs codetext
Returns: java.lang.String - Constructed codetext
getCountryCode()
public int getCountryCode()
Identifies 3 digit country code.
Returns: int
getECIEncoding()
public final int getECIEncoding()
Gets ECI encoding. Used when MaxiCodeEncodeMode is Auto. Default value: ISO-8859-1
Returns: int - ECI encoding.
getEncodeMode()
public final MaxiCodeEncodeMode getEncodeMode()
Gets a MaxiCode encode mode. Default value: Auto.
Returns: MaxiCodeEncodeMode - a MaxiCode encode mode.
getMaxiCodeEncodeMode()
public final MaxiCodeEncodeMode getMaxiCodeEncodeMode()
Gets a MaxiCode encode mode. Default value: Auto.
Returns: MaxiCodeEncodeMode - a MaxiCode encode mode.
getMode()
public int getMode()
Gets MaxiCode mode.
Returns: int - MaxiCode mode
getPostalCode()
public String getPostalCode()
Identifies the postal code. Must be 9 digits in mode 2 or 6 alphanumeric symbols in mode 3.
Returns: java.lang.String
getSecondMessage()
public MaxiCodeSecondMessage getSecondMessage()
Identifies second message of the barcode.
Returns: MaxiCodeSecondMessage
getServiceCategory()
public int getServiceCategory()
Identifies 3 digit service category.
Returns: int
hashCode()
public int hashCode()
Returns the hash code for this instance.
Returns: int - A 32-bit signed integer hash code.
initFromString(String constructedCodetext)
public void initFromString(String constructedCodetext)
Initializes instance from constructed codetext.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| constructedCodetext | java.lang.String | Constructed codetext. |
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
setCountryCode(int value)
public void setCountryCode(int value)
Identifies 3 digit country code.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | int |
setECIEncoding(int value)
public final void setECIEncoding(int value)
Sets ECI encoding. Used when MaxiCodeEncodeMode is Auto. Default value: ISO-8859-1
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | int | ECI encoding. |
setEncodeMode(MaxiCodeEncodeMode value)
public final void setEncodeMode(MaxiCodeEncodeMode value)
Sets a MaxiCode encode mode. Default value: Auto.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | MaxiCodeEncodeMode | a MaxiCode encode mode. |
setMaxiCodeEncodeMode(MaxiCodeEncodeMode value)
public final void setMaxiCodeEncodeMode(MaxiCodeEncodeMode value)
Sets a MaxiCode encode mode. Default value: Auto.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | MaxiCodeEncodeMode | a MaxiCode encode mode. |
setPostalCode(String value)
public final void setPostalCode(String value)
Identifies the postal code. Must be 9 digits in mode 2 or 6 alphanumeric symbols in mode 3.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.String |
setSecondMessage(MaxiCodeSecondMessage value)
public void setSecondMessage(MaxiCodeSecondMessage value)
Identifies second message of the barcode.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | MaxiCodeSecondMessage |
setServiceCategory(int value)
public void setServiceCategory(int value)
Identifies 3 digit service category.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | int |
toString()
public String toString()
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| arg0 | long | |
| arg1 | int |