Skip to content

AIDC Toolkit / GS1 / NonNumericIdentifierValidator

Class: NonNumericIdentifierValidator ​

Defined in: src/non-numeric-identifier-validator.ts:22

Non-numeric identifier validator.

Extends ​

Implements ​

Constructors ​

Constructor ​

new NonNumericIdentifierValidator(identifierType): NonNumericIdentifierValidator

Defined in: src/non-numeric-identifier-validator.ts:46

Constructor.

Parameters ​

identifierType ​

NonNumericIdentifierType

Identifier type.

Returns ​

NonNumericIdentifierValidator

Overrides ​

IdentifierValidator.constructor

Accessors ​

requiresCheckCharacterPair ​

Get Signature ​

get requiresCheckCharacterPair(): boolean

Defined in: src/non-numeric-identifier-validator.ts:57

Determine if the identifier requires a check character pair.

Returns ​

boolean

True if identifier requires a check character pair.

Implementation of ​

NonNumericIdentifierDescriptor.requiresCheckCharacterPair


identifierType ​

Get Signature ​

get identifierType(): IdentifierTypeDescriptor<TIdentifierType>["identifierType"]

Defined in: src/identifier-validator.ts:65

Get the identifier type. Per the GS1 General Specifications, the identifier type determines the remaining properties.

Returns ​

IdentifierTypeDescriptor<TIdentifierType>["identifierType"]

Identifier type. Per the GS1 General Specifications, the identifier type determines the remaining properties.

Implementation of ​

NonNumericIdentifierDescriptor.identifierType

Inherited from ​

IdentifierValidator.identifierType


prefixType ​

Get Signature ​

get prefixType(): IdentifierTypeDescriptor<TIdentifierType>["prefixType"]

Defined in: src/identifier-validator.ts:73

Get the prefix type supported by the identifier type. For all identifier types except the GTIN, this is a GS1 Company Prefix. For the GTIN, the prefix type determines the length.

Returns ​

IdentifierTypeDescriptor<TIdentifierType>["prefixType"]

Prefix type supported by the identifier type. For all identifier types except the GTIN, this is a GS1 Company Prefix. For the GTIN, the prefix type determines the length.

Implementation of ​

NonNumericIdentifierDescriptor.prefixType

Inherited from ​

IdentifierValidator.prefixType


length ​

Get Signature ​

get length(): IdentifierTypeDescriptor<TIdentifierType>["length"]

Defined in: src/identifier-validator.ts:82

Get the length. For numeric identifier types, the length is fixed; for alphanumeric identifier types, the length is the maximum.

Returns ​

IdentifierTypeDescriptor<TIdentifierType>["length"]

Length. For numeric identifier types, the length is fixed; for non-numeric identifier types, the length is the maximum.

Implementation of ​

NonNumericIdentifierDescriptor.length

Inherited from ​

IdentifierValidator.length


referenceCharacterSet ​

Get Signature ​

get referenceCharacterSet(): IdentifierTypeDescriptor<TIdentifierType>["referenceCharacterSet"]

Defined in: src/identifier-validator.ts:89

Get the reference character set.

Returns ​

IdentifierTypeDescriptor<TIdentifierType>["referenceCharacterSet"]

Reference character set.

Implementation of ​

NonNumericIdentifierDescriptor.referenceCharacterSet

Inherited from ​

IdentifierValidator.referenceCharacterSet


referenceCreator ​

Get Signature ​

get referenceCreator(): CharacterSetCreator

Defined in: src/identifier-validator.ts:96

Get the reference creator.

Returns ​

CharacterSetCreator

Inherited from ​

IdentifierValidator.referenceCreator

Methods ​

validate() ​

validate(identifier, validation?): void

Defined in: src/non-numeric-identifier-validator.ts:70

Validate a non-numeric identifier and throw an error if validation fails.

Parameters ​

identifier ​

string

Identifier.

validation? ​

NonNumericIdentifierValidation

Validation parameters.

Returns ​

void

Overrides ​

IdentifierValidator.validate


padIdentifier() ​

protected padIdentifier(identifier, positionOffset?): string

Defined in: src/identifier-validator.ts:113

Pad an identifier on the left with zero-value character for validation purposes. This is done to align an identifier with a position offset for any error message that may be thrown by the reference validator.

Parameters ​

identifier ​

string

Identifier.

positionOffset? ​

number

Position offset within a larger string.

Returns ​

string

Padded identifier.

Inherited from ​

IdentifierValidator.padIdentifier


validatePrefix() ​

protected validatePrefix(partialIdentifier): void

Defined in: src/identifier-validator.ts:124

Validate the prefix within an identifier.

Parameters ​

partialIdentifier ​

string

Partial identifier.

Returns ​

void

Inherited from ​

IdentifierValidator.validatePrefix