Skip to content

AIDC Toolkit / GS1 / SerializableNumericIdentifierValidator

Class: SerializableNumericIdentifierValidator

Defined in: src/serializable-numeric-identifier-validator.ts:30

Serializable numeric identifier validator. Validates both serialized and non-serialized forms of numeric identifiers that support serialization.

Extends

Implements

Constructors

Constructor

new SerializableNumericIdentifierValidator(identifierType): SerializableNumericIdentifierValidator

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

Constructor.

Parameters

identifierType

SerializableNumericIdentifierType

Identifier type.

Returns

SerializableNumericIdentifierValidator

Overrides

NonGTINNumericIdentifierValidator.constructor

Accessors

serialComponentLength

Get Signature

get serialComponentLength(): number

Defined in: src/serializable-numeric-identifier-validator.ts:77

Get the serial component length.

Returns

number

Serial component length.

Implementation of

SerializableNumericIdentifierDescriptor.serialComponentLength


serialComponentCharacterSet

Get Signature

get serialComponentCharacterSet(): ContentCharacterSet

Defined in: src/serializable-numeric-identifier-validator.ts:84

Get the serial component character set.

Returns

ContentCharacterSet

Serial component character set.

Implementation of

SerializableNumericIdentifierDescriptor.serialComponentCharacterSet


serialComponentValidation

Get Signature

get protected serialComponentValidation(): CharacterSetValidation

Defined in: src/serializable-numeric-identifier-validator.ts:91

Get the serial component validation parameters.

Returns

CharacterSetValidation


serialComponentCreator

Get Signature

get serialComponentCreator(): CharacterSetCreator

Defined in: src/serializable-numeric-identifier-validator.ts:98

Get the serial component creator.

Returns

CharacterSetCreator


leaderType

Get Signature

get leaderType(): IdentifierTypeDescriptor<TNumericIdentifierType>["leaderType"]

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

Leader type.

Returns

IdentifierTypeDescriptor<TNumericIdentifierType>["leaderType"]

Leader type.

Implementation of

SerializableNumericIdentifierDescriptor.leaderType

Inherited from

NonGTINNumericIdentifierValidator.leaderType


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

SerializableNumericIdentifierDescriptor.identifierType

Inherited from

NonGTINNumericIdentifierValidator.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

SerializableNumericIdentifierDescriptor.prefixType

Inherited from

NonGTINNumericIdentifierValidator.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

SerializableNumericIdentifierDescriptor.length

Inherited from

NonGTINNumericIdentifierValidator.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

SerializableNumericIdentifierDescriptor.referenceCharacterSet

Inherited from

NonGTINNumericIdentifierValidator.referenceCharacterSet


referenceCreator

Get Signature

get referenceCreator(): CharacterSetCreator

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

Get the reference creator.

Returns

CharacterSetCreator

Inherited from

NonGTINNumericIdentifierValidator.referenceCreator

Methods

validate()

validate(identifier, validation?): void

Defined in: src/serializable-numeric-identifier-validator.ts:105

Validate an identifier and throw an error if validation fails.

Parameters

identifier

string

Identifier.

validation?

IdentifierValidation

Identifier validation parameters.

Returns

void

Overrides

NonGTINNumericIdentifierValidator.validate


split()

split(identifier, validation?): SerializableNumericIdentifierSplit

Defined in: src/serializable-numeric-identifier-validator.ts:125

Split a serializable numeric identifier into its component parts.

Parameters

identifier

string

Identifier.

validation?

IdentifierValidation

Identifier validation parameters.

Returns

SerializableNumericIdentifierSplit

Base identifier and serial component (possibly empty) as object.


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

NonGTINNumericIdentifierValidator.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

NonGTINNumericIdentifierValidator.validatePrefix