Enum GS1CharacterSet
- All Implemented Interfaces:
Serializable, Comparable<GS1CharacterSet>, java.lang.constant.Constable
The GS1-defined character sets used to validate AI data.
Character counts and members follow GS1 General Specifications Table 7-11.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(char c) Returnstrueifcis a member of this character set.static GS1CharacterSetforComponentType(String type, String formatString) Maps an AI component type code and the AI-level format string to the appropriateGS1CharacterSetfor character-level validation.getChars()Returns the complete string of characters permitted in this set.static GS1CharacterSetReturns the enum constant of this type with the specified name.static GS1CharacterSet[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NUMERIC
Digits0–9only. -
CSET39
GS1 AI encodable character set 39. Digits0–9, uppercaseA–Z, and# - /(39 characters total). -
CSET64
GS1 AI encodable character set 64. Digits0–9, upper- and lower-case letters,-,_, and=(64 characters total). -
CSET82
GS1 AI encodable character set 82. Digits, upper- and lower-case letters, and the 20 permitted special characters!"&'()*+,-./:;<=>?_%(82 characters total).
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getChars
Returns the complete string of characters permitted in this set.- Returns:
- the chars.
-
contains
public boolean contains(char c) Returnstrueifcis a member of this character set.- Parameters:
c- the c- Returns:
trueif contains.
-
forComponentType
Maps an AI component type code and the AI-level format string to the appropriateGS1CharacterSetfor character-level validation.For alphanumeric (
"X") components the format string narrows the set:- Parameters:
type- the component type code ("N"or"X")formatString- the AI-level format string (e.g."X..20"), may benull- Returns:
- the character set to validate against, or
nullto skip charset checking
-