final class PDF417HighLevelEncoder
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
PDF417HighLevelEncoder.NoECIInput |
Modifier and Type | Field and Description |
---|---|
private static int |
BYTE_COMPACTION
code for Byte compaction
|
private static java.nio.charset.Charset |
DEFAULT_ENCODING |
private static int |
ECI_CHARSET
identifier for an ECI of a character set of code page
|
private static int |
ECI_GENERAL_PURPOSE
identifier for a general purpose ECO format
|
private static int |
ECI_USER_DEFINED
identifier for a user defined Extended Channel Interpretation (ECI)
|
private static int |
LATCH_TO_BYTE
mode latch to Byte Compaction mode (number of characters a multiple of 6)
|
private static int |
LATCH_TO_BYTE_PADDED
mode latch to Byte Compaction mode (number of characters NOT a multiple of 6)
|
private static int |
LATCH_TO_NUMERIC
mode latch to Numeric Compaction mode
|
private static int |
LATCH_TO_TEXT
mode latch to Text Compaction mode
|
private static byte[] |
MIXED |
private static int |
NUMERIC_COMPACTION
code for Numeric compaction
|
private static byte[] |
PUNCTUATION |
private static int |
SHIFT_TO_BYTE
mode shift to Byte Compaction mode
|
private static int |
SUBMODE_ALPHA
Text compaction submode Alpha
|
private static int |
SUBMODE_LOWER
Text compaction submode Lower
|
private static int |
SUBMODE_MIXED
Text compaction submode Mixed
|
private static int |
SUBMODE_PUNCTUATION
Text compaction submode Punctuation
|
private static int |
TEXT_COMPACTION
code for Text compaction
|
private static byte[] |
TEXT_MIXED_RAW
Raw code table for text compaction Mixed sub-mode
|
private static byte[] |
TEXT_PUNCTUATION_RAW
Raw code table for text compaction: Punctuation sub-mode
|
Modifier | Constructor and Description |
---|---|
private |
PDF417HighLevelEncoder() |
Modifier and Type | Method and Description |
---|---|
private static int |
determineConsecutiveBinaryCount(ECIInput input,
int startpos,
java.nio.charset.Charset encoding)
Determines the number of consecutive characters that are encodable using binary compaction.
|
private static int |
determineConsecutiveDigitCount(ECIInput input,
int startpos)
Determines the number of consecutive characters that are encodable using numeric compaction.
|
private static int |
determineConsecutiveTextCount(ECIInput input,
int startpos)
Determines the number of consecutive characters that are encodable using text compaction.
|
private static void |
encodeBinary(byte[] bytes,
int startpos,
int count,
int startmode,
java.lang.StringBuilder sb)
Encode parts of the message using Byte Compaction as described in ISO/IEC 15438:2001(E),
chapter 4.4.3.
|
(package private) static java.lang.String |
encodeHighLevel(java.lang.String msg,
Compaction compaction,
java.nio.charset.Charset encoding,
boolean autoECI)
Performs high-level encoding of a PDF417 message using the algorithm described in annex P
of ISO/IEC 15438:2001(E).
|
private static void |
encodeMultiECIBinary(ECIInput input,
int startpos,
int count,
int startmode,
java.lang.StringBuilder sb)
Encode all of the message using Byte Compaction as described in ISO/IEC 15438:2001(E)
|
private static void |
encodeNumeric(ECIInput input,
int startpos,
int count,
java.lang.StringBuilder sb) |
private static int |
encodeText(ECIInput input,
int startpos,
int count,
java.lang.StringBuilder sb,
int initialSubmode)
Encode parts of the message using Text Compaction as described in ISO/IEC 15438:2001(E),
chapter 4.4.2.
|
private static void |
encodingECI(int eci,
java.lang.StringBuilder sb) |
private static boolean |
isAlphaLower(char ch) |
private static boolean |
isAlphaUpper(char ch) |
private static boolean |
isDigit(char ch) |
private static boolean |
isMixed(char ch) |
private static boolean |
isPunctuation(char ch) |
private static boolean |
isText(char ch) |
(package private) static byte[] |
subBytes(ECIInput input,
int start,
int end) |
private static final int TEXT_COMPACTION
private static final int BYTE_COMPACTION
private static final int NUMERIC_COMPACTION
private static final int SUBMODE_ALPHA
private static final int SUBMODE_LOWER
private static final int SUBMODE_MIXED
private static final int SUBMODE_PUNCTUATION
private static final int LATCH_TO_TEXT
private static final int LATCH_TO_BYTE_PADDED
private static final int LATCH_TO_NUMERIC
private static final int SHIFT_TO_BYTE
private static final int LATCH_TO_BYTE
private static final int ECI_USER_DEFINED
private static final int ECI_GENERAL_PURPOSE
private static final int ECI_CHARSET
private static final byte[] TEXT_MIXED_RAW
private static final byte[] TEXT_PUNCTUATION_RAW
private static final byte[] MIXED
private static final byte[] PUNCTUATION
private static final java.nio.charset.Charset DEFAULT_ENCODING
static java.lang.String encodeHighLevel(java.lang.String msg, Compaction compaction, java.nio.charset.Charset encoding, boolean autoECI) throws WriterException
msg
- the messagecompaction
- compaction mode to useencoding
- character encoding used to encode in default or byte compaction
or null
for default / not applicableautoECI
- encode input minimally using multiple ECIs if needed
If autoECI encoding is specified and additionally encoding
is specified, then the encoder
will use the specified Charset
for any character that can be encoded by it, regardless
if a different encoding would lead to a more compact encoding. When no encoding
is specified
then charsets will be chosen so that the byte representation is minimal.WriterException
private static int encodeText(ECIInput input, int startpos, int count, java.lang.StringBuilder sb, int initialSubmode) throws WriterException
input
- the inputstartpos
- the start position within the messagecount
- the number of characters to encodesb
- receives the encoded codewordsinitialSubmode
- should normally be SUBMODE_ALPHAWriterException
private static void encodeMultiECIBinary(ECIInput input, int startpos, int count, int startmode, java.lang.StringBuilder sb) throws WriterException
input
- the inputstartpos
- the start position within the messagecount
- the number of bytes to encodestartmode
- the mode from which this method startssb
- receives the encoded codewordsWriterException
static byte[] subBytes(ECIInput input, int start, int end)
private static void encodeBinary(byte[] bytes, int startpos, int count, int startmode, java.lang.StringBuilder sb)
bytes
- the message converted to a byte arraystartpos
- the start position within the messagecount
- the number of bytes to encodestartmode
- the mode from which this method startssb
- receives the encoded codewordsprivate static void encodeNumeric(ECIInput input, int startpos, int count, java.lang.StringBuilder sb)
private static boolean isDigit(char ch)
private static boolean isAlphaUpper(char ch)
private static boolean isAlphaLower(char ch)
private static boolean isMixed(char ch)
private static boolean isPunctuation(char ch)
private static boolean isText(char ch)
private static int determineConsecutiveDigitCount(ECIInput input, int startpos)
input
- the inputstartpos
- the start position within the inputprivate static int determineConsecutiveTextCount(ECIInput input, int startpos)
input
- the inputstartpos
- the start position within the inputprivate static int determineConsecutiveBinaryCount(ECIInput input, int startpos, java.nio.charset.Charset encoding) throws WriterException
input
- the inputstartpos
- the start position within the messageencoding
- the charset used to convert the message to a byte arrayWriterException
private static void encodingECI(int eci, java.lang.StringBuilder sb) throws WriterException
WriterException