Interface IdentificationKeyCreator

Identification key creator. Creates an identification key based on its definition in section 3 of the GS1 General Specifications.

Keys are created based on a prefix defined in a prefix manager to which the identification key creator is bound.

interface IdentificationKeyCreator {
    get referenceCreator(): CharacterSetCreator;
    get prefixManager(): PrefixManager;
    get prefix(): string;
    get referenceLength(): number;
    get identificationKeyType(): IdentificationKeyType;
    get prefixType(): PrefixType;
    get length(): number;
    get referenceCharacterSet(): CharacterSet;
    get referenceValidator(): CharacterSetValidator;
    validate: ((identificationKey: string, validation?: IdentificationKeyValidation) => void);
}

Hierarchy (view full)

Properties

validate: ((identificationKey: string, validation?: IdentificationKeyValidation) => void)

Validate an identification key and throw an exception if validation fails.

Type declaration

    • (identificationKey, validation?): void
    • Parameters

      Returns void

Accessors

  • get referenceLength(): number
  • Get the reference length.

    Returns number

  • get identificationKeyType(): IdentificationKeyType
  • Get the identification key type. Per the GS1 General Specifications, the identification key type determines the remaining properties.

    Returns IdentificationKeyType

  • get prefixType(): PrefixType
  • Get the prefix type supported by the identification key type. For all identification key types except the GTIN, this is PrefixType.GS1CompanyPrefix. For the GTIN, the prefix type determines the length.

    Returns PrefixType

  • get length(): number
  • Get the length. For numeric identification key types, the length is fixed; for alphanumeric identification key types, the length is the maximum.

    Returns number

  • get referenceCharacterSet(): CharacterSet
  • Get the reference character set.

    Returns CharacterSet