Package io.scanbot.sdk.barcode
Enum Gs1Handling
- java.lang.Object
-
- java.lang.Enum<Gs1Handling>
-
- io.scanbot.sdk.barcode.Gs1Handling
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Gs1Handling>
public enum Gs1Handling extends java.lang.Enum<Gs1Handling>
GS1 message handling options. The GS1 standard defines a key-value format for business-centric data that can be encoded into many 1D and 2D barcode types. https://ref.gs1.org/standards/genspecs/ GS1 messages have two representations or formats: a human-readable format and a machine-readable format. The human-readable format uses parentheses to wrap the keys in each pair. For example, the string "(01)012345678901(37)02(3922)00278" contains three AI keys: 01, 37, and 3922. The corresponding values are 012345678901, 02, and 00278. The machine-readable format uses the special ASCII \x1D character to terminate key-value pairs in the string in cases where the given key implies that the value is variable-length. The equivalent machine-readable string for the above example is "010123456789013702\x1D392200278". In the above example, the 01 AI key is fixed-length, so the \x1D character is not necessary. The 37 AI keys is variable-length, so the \x1D character is necessary after the value in the pair. The 3922 AI key is also variable-length, but it is the last pair in the message, so the \x1D character is not necessary at the end. The character \x1D is UNPRINTABLE - this means that if you try to print or otherwise visualize a GS1 message containing the \x1D character, you may see a number of different results, depending on how the system handles unprintable characters. You may see a question mark, a box, an escape sequence, a space or nothing at all.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DECODE_FULLCombines the validations of VALIDATE_FULL and the human-readable output format of DECODE_STRUCTURE.DECODE_STRUCTURESame as VALIDATE_STRUCTURE.PARSEThis is the default.VALIDATE_FULLIncludes all validations from VALIDATE_STRUCTURE.VALIDATE_STRUCTURESame as PARSE.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Gs1HandlingvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Gs1Handling[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PARSE
public static final Gs1Handling PARSE
This is the default. GS1 messages are converted to the machine-readable format per the GS1 spec (the special FNC1 character is converted to ASCII \x1D). The implied 01 AI key is prepended to DataBar results. No validation is performed.
-
VALIDATE_STRUCTURE
public static final Gs1Handling VALIDATE_STRUCTURE
Same as PARSE. Additionally, messages containing unknown AI keys, or containing values that don't fulfill the length, character set or regex requirements for known keys, are rejected.
-
DECODE_STRUCTURE
public static final Gs1Handling DECODE_STRUCTURE
Same as VALIDATE_STRUCTURE. Additionally, GS1 strings are converted to the human-readable format, instead (with parentheses used to wrap AI keys, e.g. "(01)123456789"). The \x1D character is never used in this representation.
-
VALIDATE_FULL
public static final Gs1Handling VALIDATE_FULL
Includes all validations from VALIDATE_STRUCTURE. Additionally, GS1 messages which have missing or incompatible combinations of AI keys are rejected. Additionally, values are checked against a list of known linting rules, e.g. checksums are calculated and verified, dates are checked for validity, etc. Results that fail any of the linter rules are rejected. The complete set of linter rules from the GS1 Syntax Dictionary are implemented.
-
DECODE_FULL
public static final Gs1Handling DECODE_FULL
Combines the validations of VALIDATE_FULL and the human-readable output format of DECODE_STRUCTURE.
-
-
Method Detail
-
values
public static Gs1Handling[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Gs1Handling c : Gs1Handling.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Gs1Handling valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-