AIDC Toolkit / GS1 / AbstractIdentifierCreator
Abstract Class: AbstractIdentifierCreator
Defined in: src/identifier-creator.ts:35
Abstract identifier creator. Implements common functionality for an identifier creator, bound to a PrefixProvider.
Extended by
Implements
Constructors
Constructor
new AbstractIdentifierCreator():
AbstractIdentifierCreator
Returns
AbstractIdentifierCreator
Accessors
identifierType
Get Signature
get
abstractidentifierType():IdentifierType
Defined in: src/identifier-creator.ts:65
Get the identifier type. Per the GS1 General Specifications, the identifier type determines the remaining properties.
Returns
Implementation of
IdentifierCreator.identifierType
prefixType
Get Signature
get
abstractprefixType():PrefixType
Defined in: src/identifier-creator.ts:67
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
Implementation of
length
Get Signature
get
abstractlength():number
Defined in: src/identifier-creator.ts:69
Get the length. For numeric identifier types, the length is fixed; for alphanumeric identifier types, the length is the maximum.
Returns
number
Implementation of
referenceCharacterSet
Get Signature
get
abstractreferenceCharacterSet():ContentCharacterSet
Defined in: src/identifier-creator.ts:71
Get the reference character set.
Returns
Implementation of
IdentifierCreator.referenceCharacterSet
referenceCreator
Get Signature
get
abstractreferenceCreator():CharacterSetCreator
Defined in: src/identifier-creator.ts:73
Get the reference creator.
Returns
Implementation of
IdentifierCreator.referenceCreator
prefixProvider
Get Signature
get prefixProvider():
PrefixProvider
Defined in: src/identifier-creator.ts:78
Get the prefix provider to which this identifier creator is bound.
Returns
PrefixProvider
Implementation of
IdentifierCreator.prefixProvider
prefix
Get Signature
get prefix():
string
Defined in: src/identifier-creator.ts:85
Get the prefix, equivalent to calling PrefixProvider.prefix | prefixProvider.prefix for a GTIN or PrefixProvider.gs1CompanyPrefix | prefixProvider.gs1CompanyPrefix for all other identifier types.
Returns
string
Implementation of
referenceLength
Get Signature
get referenceLength():
number
Defined in: src/identifier-creator.ts:92
Get the reference length.
Returns
number
Implementation of
IdentifierCreator.referenceLength
Methods
init()
protectedinit(prefixProvider,prefix,checkAllowance):void
Defined in: src/identifier-creator.ts:58
Initialize the prefix manager. 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.
checkAllowance
number
Number of characters to allow for check digit or check character pair.
Returns
void
validate()
abstractvalidate(identifier,validation?):void
Defined in: src/identifier-creator.ts:96
Validate an identifier and throw an error if validation fails.
Parameters
identifier
string
Identifier.
validation?
Identifier validation parameters.
Returns
void