Skip to content

AIDC Toolkit / GS1 / NonGTINNumericIdentifierCreator

Class: NonGTINNumericIdentifierCreator

Defined in: src/non-gtin-numeric-identifier-creator.ts:11

Non-GTIN numeric identifier creator.

Extends

Constructors

Constructor

new NonGTINNumericIdentifierCreator(prefixProvider, identifierType, length, leaderType): NonGTINNumericIdentifierCreator

Defined in: src/non-gtin-numeric-identifier-creator.ts:28

Constructor. Typically called internally by a prefix manager but may be called by other code with another prefix provider type.

Parameters

prefixProvider

PrefixProvider

Prefix provider.

identifierType

IdentifierType

Identifier type.

length

number

Length.

leaderType

string = LeaderTypes.None

Leader type.

Returns

NonGTINNumericIdentifierCreator

Overrides

Mixin(NonGTINNumericIdentifierValidator, AbstractNumericIdentifierCreator).constructor

Accessors

leaderType

Get Signature

get leaderType(): string

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

Inherit Doc
Returns

string

Inherited from

AbstractNumericIdentifierValidator.leaderType


identifierType

Get Signature

get identifierType(): IdentifierType

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

Inherit Doc
Returns

IdentifierType

Inherited from

AbstractIdentifierValidator.identifierType


prefixType

Get Signature

get prefixType(): PrefixType

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

Inherit Doc
Returns

PrefixType

Inherited from

AbstractIdentifierValidator.prefixType


length

Get Signature

get length(): number

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

Inherit Doc
Returns

number

Inherited from

AbstractIdentifierValidator.length


referenceCharacterSet

Get Signature

get referenceCharacterSet(): ContentCharacterSet

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

Inherit Doc
Returns

ContentCharacterSet

Inherited from

AbstractIdentifierValidator.referenceCharacterSet


referenceCreator

Get Signature

get referenceCreator(): CharacterSetCreator

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

Inherit Doc
Returns

CharacterSetCreator

Inherited from

AbstractIdentifierValidator.referenceCreator


capacity

Get Signature

get capacity(): number

Defined in: src/numeric-identifier-creator.ts:89

Inherit Doc
Returns

number

Inherited from

Mixin(NonGTINNumericIdentifierValidator, AbstractNumericIdentifierCreator).capacity


tweak

Get Signature

get tweak(): bigint

Defined in: src/numeric-identifier-creator.ts:96

Get the tweak for sparse creation.

Returns

bigint

Set Signature

set tweak(value): void

Defined in: src/numeric-identifier-creator.ts:103

Set the tweak for sparse creation.

Parameters
value

bigint

Returns

void

Inherited from

Mixin(NonGTINNumericIdentifierValidator, AbstractNumericIdentifierCreator).tweak


prefixProvider

Get Signature

get prefixProvider(): PrefixProvider

Defined in: src/identifier-creator.ts:78

Inherit Doc
Returns

PrefixProvider

Inherited from

Mixin(NonGTINNumericIdentifierValidator, AbstractNumericIdentifierCreator).prefixProvider


prefix

Get Signature

get prefix(): string

Defined in: src/identifier-creator.ts:85

Inherit Doc
Returns

string

Inherited from

Mixin(NonGTINNumericIdentifierValidator, AbstractNumericIdentifierCreator).prefix


referenceLength

Get Signature

get referenceLength(): number

Defined in: src/identifier-creator.ts:92

Inherit Doc
Returns

number

Inherited from

Mixin(NonGTINNumericIdentifierValidator, AbstractNumericIdentifierCreator).referenceLength

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

Mixin(NonGTINNumericIdentifierValidator, AbstractNumericIdentifierCreator).creatorFor


validate()

validate(identifier, validation?): void

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

Parameters

identifier

string

validation?

IdentifierValidation

Returns

void

Inherit Doc

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

Mixin(NonGTINNumericIdentifierValidator, AbstractNumericIdentifierCreator).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

Mixin(NonGTINNumericIdentifierValidator, AbstractNumericIdentifierCreator).validatePrefix


init()

protected init(prefixProvider, prefix): void

Defined in: src/numeric-identifier-creator.ts:77

Initialize the prefix provider. This method is in lieu of a constructor due to the mixin architecture.

Parameters

prefixProvider

PrefixProvider

Prefix provider.

prefix

string

Prefix within prefix manager to use to calculate reference length.

Returns

void

Inherited from

Mixin(NonGTINNumericIdentifierValidator, AbstractNumericIdentifierCreator).init


create()

create<TTransformerInput>(valueOrValues, sparse): TransformerOutput<TTransformerInput, string>

Defined in: src/numeric-identifier-creator.ts:125

Type Parameters

TTransformerInput

TTransformerInput extends TransformerInput<number | bigint>

Parameters

valueOrValues

TTransformerInput

sparse

boolean = false

Returns

TransformerOutput<TTransformerInput, string>

Inherit Doc

Inherited from

Mixin(NonGTINNumericIdentifierValidator, AbstractNumericIdentifierCreator).create


createAll()

createAll(): Iterable<string>

Defined in: src/numeric-identifier-creator.ts:184

Returns

Iterable<string>

Inherit Doc

Inherited from

Mixin(NonGTINNumericIdentifierValidator, AbstractNumericIdentifierCreator).createAll