public enum HanXinEncodeMode extends java.lang.Enum<HanXinEncodeMode>
Han Xin Code encoding mode. It is recommended to use Auto with ASCII / Chinese characters or Unicode for Unicode characters.
// Auto mode String codetext = "1234567890ABCDEFGabcdefg,Han Xin Code"; BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.HAN_XIN, codetext); generator.save("test.bmp"); // Bytes mode byte[] encodedArr = new byte[] {(byte) 0xFF, (byte) 0xFE, (byte) 0xFD, (byte) 0xFC, (byte) 0xFB, (byte) 0xFA, (byte) 0xF9}; //encode array to string StringBuilder strBld = new StringBuilder(); for (byte bval : encodedArr) strBld.append((char) bval); String codetext = strBld.toString(); BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.HAN_XIN, codetext); generator.getParameters().getBarcode().getHanXin().setHanXinEncodeMode(HanXinEncodeMode.BYTES); generator.save("test.bmp"); // ECI mode String codetext = "ΑΒΓΔΕ"; BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.HAN_XIN, codetext); generator.getParameters().getBarcode().getHanXin().setHanXinEncodeMode(HanXinEncodeMode.ECI); generator.getParameters().getBarcode().getHanXin().setHanXinECIEncoding(ECIEncodings.ISO_8859_7); generator.save("test.bmp"); // URI mode String codetext = "https://www.test.com/%BC%DE%%%ab/search=test"; BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.HAN_XIN, codetext); generator.getParameters().getBarcode().getHanXin().setHanXinEncodeMode(HanXinEncodeMode.URI); generator.save("test.bmp"); // Extended mode - TBD
Enum Constant and Description |
---|
AUTO
Sequence of Numeric, Text, ECI, Binary Bytes and 4 GB18030 modes changing automatically.
|
BINARY
Binary byte mode encodes binary data in any form and encodes them in their binary byte.
|
ECI
Extended Channel Interpretation (ECI) mode
|
EXTENDED
Extended mode will allow more flexible combinations of other modes, this mode is currently not implemented.
|
UNICODE
Unicode mode designs a way to represent any text data reference to UTF8 encoding/charset in Han Xin Code.
|
URI
URI mode indicates the data represented in Han Xin Code is Uniform Resource Identifier (URI)
reference to RFC 3986.
|
Modifier and Type | Method and Description |
---|---|
int |
getValue() |
static HanXinEncodeMode |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static HanXinEncodeMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final HanXinEncodeMode AUTO
Sequence of Numeric, Text, ECI, Binary Bytes and 4 GB18030 modes changing automatically.
public static final HanXinEncodeMode BINARY
Binary byte mode encodes binary data in any form and encodes them in their binary byte. Every byte in Binary Byte mode is represented by 8 bits.
public static final HanXinEncodeMode ECI
Extended Channel Interpretation (ECI) mode
public static final HanXinEncodeMode UNICODE
Unicode mode designs a way to represent any text data reference to UTF8 encoding/charset in Han Xin Code.
public static final HanXinEncodeMode URI
URI mode indicates the data represented in Han Xin Code is Uniform Resource Identifier (URI) reference to RFC 3986.
public static final HanXinEncodeMode EXTENDED
Extended mode will allow more flexible combinations of other modes, this mode is currently not implemented.
public static HanXinEncodeMode[] values()
for (HanXinEncodeMode c : HanXinEncodeMode.values()) System.out.println(c);
public static HanXinEncodeMode valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic int getValue()