Enum Class DataMatrixEncodeMode
- All Implemented Interfaces:
Serializable,Comparable<DataMatrixEncodeMode>,Constable
DataMatrix encoder's encoding mode, default to Auto
This sample shows how to do codetext in Extended Mode.//Auto mode String codetext = "犬Right狗"; BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX, codetext); generator.getParameters().getBarcode().getDataMatrix().setECIEncoding(ECIEncodings.UTF8); generator.save("test.bmp"); //Bytes mode byte[] encodedArr = { (byte)0xFF, (byte)0xFE, (byte)0xFD, (byte)0xFC, (byte)0xFB, (byte)0xFA, (byte)0xF9 }; BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX); generator.setCodetext(encodedArr); generator.getParameters().getBarcode().getDataMatrix().setEncodeMode(EncodeMode.BINARY); generator.save("test.bmp"); //Extended codetext mode //create codetext DataMatrixExtCodetextBuilder codetextBuilder=new DataMatrixExtCodetextBuilder(); codetextBuilder.addECICodetextWithEncodeMode(ECIEncodings.Win1251,EncodeMode.BYTES,"World"); codetextBuilder.addPlainCodetext("Will"); codetextBuilder.addECICodetext(ECIEncodings.UTF8,"犬Right狗"); codetextBuilder.addCodetextWithEncodeMode(EncodeMode.C40,"ABCDE"); //generate codetext String codetext=codetextBuilder.getExtended(); //generate BarcodeGenerator generator=new BarcodeGenerator(EncodeTypes.DATA_MATRIX,codetext); generator.getParameters().getBarcode().getDataMatrix().setEncodeMode(EncodeMode.EXTENDED_CODETEXT); generator.save("test.bmp");
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUses ANSI X12 encoding.Encodes one alphanumeric or two numeric characters per byteIn Auto mode, the CodeText is encoded with maximum data compactness.Encode 8 bit valuesIn Binary mode, the CodeText is encoded with maximum data compactness.Deprecated.This property is obsolete and will be removed in future releases.Uses C40 encoding.In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier.Uses EDIFACT encoding.ExtendedCodetext mode allows to manually switch encodation schemes and ECI encodings in codetext.Deprecated.This property is obsolete and will be removed in future releases.Uses Text encoding. -
Method Summary
Modifier and TypeMethodDescriptionintgetValue()static DataMatrixEncodeModeReturns the enum constant of this class with the specified name.static DataMatrixEncodeMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AUTO
In Auto mode, the CodeText is encoded with maximum data compactness. Unicode characters are re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier. If a character is found that is not supported by the selected ECI encoding, an exception is thrown. -
ASCII
Encodes one alphanumeric or two numeric characters per byte
-
BYTES
Deprecated.This property is obsolete and will be removed in future releases. Instead, use Base256 option.Encode 8 bit values -
C40
Uses C40 encoding. Encodes Upper-case alphanumeric, Lower case and special characters
-
TEXT
Uses Text encoding. Encodes Lower-case alphanumeric, Upper case and special characters
-
EDIFACT
Uses EDIFACT encoding. Uses six bits per character, encodes digits, upper-case letters, and many punctuation marks, but has no support for lower-case letters.
-
ANSIX12
Uses ANSI X12 encoding.
-
EXTENDED_CODETEXT
Deprecated.This property is obsolete and will be removed in future releases. Instead, use the 'Extended' encode modeExtendedCodetext mode allows to manually switch encodation schemes and ECI encodings in codetext.
It is better to use DataMatrixExtCodetextBuilder for extended codetext generation.
Use Display2DText property to set visible text to removing managing characters.
ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier
All unicode characters after ECI identifier are automatically encoded into correct character codeset.
Encodation schemes are set in the next format : "\Encodation_scheme_name:text\Encodation_scheme_name:text".
Allowed encodation schemes are: EDIFACT, ANSIX12, ASCII, C40, Text, Auto.
All backslashes (\) must be doubled in text.
-
EXTENDED
ExtendedCodetext mode allows to manually switch encodation schemes and ECI encodings in codetext. It is better to use DataMatrixExtCodetextBuilder for extended codetext generation. Use Display2DText property to set visible text to removing managing characters. ECI identifiers are set as single slash and six digits identifier "\000026" - UTF8 ECI identifier All unicode characters after ECI identifier are automatically encoded into correct character codeset. Encodation schemes are set in the next format : "\Encodation_scheme_name:text\Encodation_scheme_name:text". Allowed encodation schemes are: EDIFACT, ANSIX12, ASCII, C40, Text, Auto. All backslashes (\) must be doubled in text. -
BASE_256
Encode 8 bit values -
BINARY
In Binary mode, the CodeText is encoded with maximum data compactness. If a Unicode character is found, an exception is thrown. -
ECI
In ECI mode, the entire message is re-encoded in the ECIEncoding specified encoding with the insertion of an ECI identifier. If a character is found that is not supported by the selected ECI encoding, an exception is thrown. Please note that some old (pre 2006) scanners may not support this mode.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getValue
public int getValue()
-