Skip to content

AIDC Toolkit / GS1 / NonGTINNumericIdentifierValidator

Class: NonGTINNumericIdentifierValidator

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

Non-GTIN numeric identifier validator.

Extends

Extended by

Constructors

Constructor

new NonGTINNumericIdentifierValidator(identifierType, length, leaderType): NonGTINNumericIdentifierValidator

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

Constructor.

Parameters

identifierType

IdentifierType

Identifier type.

length

number

Length.

leaderType

string = LeaderTypes.None

Leader type.

Returns

NonGTINNumericIdentifierValidator

Overrides

AbstractNumericIdentifierValidator.constructor

Accessors

leaderType

Get Signature

get leaderType(): string

Defined in: src/numeric-identifier-validator.ts:100

Get the leader type.

Returns

string

Inherited from

AbstractNumericIdentifierValidator.leaderType


identifierType

Get Signature

get identifierType(): IdentifierType

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

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

Returns

IdentifierType

Inherited from

AbstractNumericIdentifierValidator.identifierType


prefixType

Get Signature

get prefixType(): PrefixType

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

Get the prefix type supported by the identifier type. For all identifier types except the GTIN, this is PrefixTypes.GS1CompanyPrefix. For the GTIN, the prefix type determines the length.

Returns

PrefixType

Inherited from

AbstractNumericIdentifierValidator.prefixType


length

Get Signature

get length(): number

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

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

Returns

number

Inherited from

AbstractNumericIdentifierValidator.length


referenceCharacterSet

Get Signature

get referenceCharacterSet(): ContentCharacterSet

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

Get the reference character set.

Returns

ContentCharacterSet

Inherited from

AbstractNumericIdentifierValidator.referenceCharacterSet


referenceCreator

Get Signature

get referenceCreator(): CharacterSetCreator

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

Get the reference creator.

Returns

CharacterSetCreator

Inherited from

AbstractNumericIdentifierValidator.referenceCreator

Methods

creatorFor()

protected static creatorFor(characterSet): CharacterSetCreator

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

Get the character set creator for a character set.

Parameters

characterSet

ContentCharacterSet

Character set.

Returns

CharacterSetCreator

Character set creator.

Inherited from

AbstractNumericIdentifierValidator.creatorFor


validate()

validate(identifier, validation?): void

Defined in: src/numeric-identifier-validator.ts:107

Validate an identifier and throw an error if validation fails.

Parameters

identifier

string

Identifier.

validation?

IdentifierValidation

Identifier validation parameters.

Returns

void

Inherited from

AbstractNumericIdentifierValidator.validate


padIdentifier()

protected padIdentifier(identifier, validation): string

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

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.

validation

Identifier validation parameters.

IdentifierValidation | undefined

Returns

string

Padded identifier.

Inherited from

AbstractNumericIdentifierValidator.padIdentifier


validatePrefix()

protected validatePrefix(partialIdentifier, positionOffset?): void

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

Validate the prefix within an identifier.

Parameters

partialIdentifier

string

Partial identifier.

positionOffset?

number

Position offset within a larger string.

Returns

void

Inherited from

AbstractNumericIdentifierValidator.validatePrefix