Class MaxiCodeStructuredCodetext

java.lang.Object
com.aspose.barcode.complexbarcode.MaxiCodeCodetext
com.aspose.barcode.complexbarcode.MaxiCodeStructuredCodetext
All Implemented Interfaces:
IComplexCodetext
Direct Known Subclasses:
MaxiCodeCodetextMode2, MaxiCodeCodetextMode3

public abstract class MaxiCodeStructuredCodetext extends MaxiCodeCodetext
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.
  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 MaxiCodeStructuredCodetext)
      {
          MaxiCodeStructuredCodetext maxiCodeStructuredCodetext = (MaxiCodeStructuredCodetext)resultMaxiCodeCodetext;
          System.out.println("BarCode Type: " + maxiCodeStructuredCodetext.getPostalCode());
          System.out.println("MaxiCode mode: " + maxiCodeStructuredCodetext.getCountryCode());
          System.out.println("BarCode CodeText: " + maxiCodeStructuredCodetext.getServiceCategory());
      }
  }
  
  • Constructor Details

    • MaxiCodeStructuredCodetext

      public MaxiCodeStructuredCodetext()
  • Method Details

    • getPostalCode

      public String getPostalCode()
      Identifies the postal code. Must be 9 digits in mode 2 or 6 alphanumeric symbols in mode 3.
    • setPostalCode

      public final void setPostalCode(String value)
      Identifies the postal code. Must be 9 digits in mode 2 or 6 alphanumeric symbols in mode 3.
    • getCountryCode

      public int getCountryCode()
      Identifies 3 digit country code.
    • setCountryCode

      public void setCountryCode(int value)
      Identifies 3 digit country code.
    • getServiceCategory

      public int getServiceCategory()
      Identifies 3 digit service category.
    • setServiceCategory

      public void setServiceCategory(int value)
      Identifies 3 digit service category.
    • getSecondMessage

      public MaxiCodeSecondMessage getSecondMessage()
      Identifies second message of the barcode.
    • setSecondMessage

      public void setSecondMessage(MaxiCodeSecondMessage value)
      Identifies second message of the barcode.
    • getConstructedCodetext

      public String getConstructedCodetext()
      Constructs codetext
      Specified by:
      getConstructedCodetext in interface IComplexCodetext
      Specified by:
      getConstructedCodetext in class MaxiCodeCodetext
      Returns:
      Constructed codetext
    • initFromString

      public void initFromString(String constructedCodetext)
      Initializes instance from constructed codetext.
      Specified by:
      initFromString in interface IComplexCodetext
      Specified by:
      initFromString in class MaxiCodeCodetext
      Parameters:
      constructedCodetext - Constructed codetext.
    • equals

      public boolean equals(Object obj)
      Returns a value indicating whether this instance is equal to a specified MaxiCodeStructuredCodetext value.
      Overrides:
      equals in class Object
      Parameters:
      obj - An MaxiCodeStructuredCodetext value to compare to this instance
      Returns:
      true if obj has the same value as this instance; otherwise, false
    • hashCode

      public int hashCode()
      Returns the hash code for this instance.
      Overrides:
      hashCode in class Object
      Returns:
      A 32-bit signed integer hash code.