AIDC Toolkit / GS1 / NonNumericIdentifierCreator
Class: NonNumericIdentifierCreator
Defined in: src/non-numeric-identifier-creator.ts:19
Non-numeric identifier creator.
Extends
NonNumericIdentifierValidator<this> &AbstractIdentifierCreator<this>
Constructors
Constructor
new NonNumericIdentifierCreator(
prefixProvider,identifierType,length,referenceCharacterSet,requiresCheckCharacterPair):NonNumericIdentifierCreator
Defined in: src/non-numeric-identifier-creator.ts:44
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
Identifier type.
length
number
Length.
referenceCharacterSet
Reference character set.
requiresCheckCharacterPair
boolean = false
True if the identifier requires a check character pair.
Returns
NonNumericIdentifierCreator
Overrides
Mixin(NonNumericIdentifierValidator, AbstractIdentifierCreator).constructor
Accessors
referenceValidation
Get Signature
get
protectedreferenceValidation():CharacterSetValidation
Defined in: src/non-numeric-identifier-creator.ts:60
Get the reference validation parameters.
Returns
requiresCheckCharacterPair
Get Signature
get requiresCheckCharacterPair():
boolean
Defined in: src/non-numeric-identifier-validator.ts:75
Determine if the identifier requires a check character pair.
Returns
boolean
Inherited from
Mixin(NonNumericIdentifierValidator, AbstractIdentifierCreator).requiresCheckCharacterPair
identifierType
Get Signature
get identifierType():
IdentifierType
Defined in: src/identifier-validator.ts:170
Inherit Doc
Returns
Inherited from
AbstractIdentifierValidator.identifierType
prefixType
Get Signature
get prefixType():
PrefixType
Defined in: src/identifier-validator.ts:177
Inherit Doc
Returns
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
Inherited from
AbstractIdentifierValidator.referenceCharacterSet
referenceCreator
Get Signature
get referenceCreator():
CharacterSetCreator
Defined in: src/identifier-validator.ts:198
Inherit Doc
Returns
Inherited from
AbstractIdentifierValidator.referenceCreator
prefixProvider
Get Signature
get prefixProvider():
PrefixProvider
Defined in: src/identifier-creator.ts:78
Inherit Doc
Returns
PrefixProvider
Inherited from
Mixin(NonNumericIdentifierValidator, AbstractIdentifierCreator).prefixProvider
prefix
Get Signature
get prefix():
string
Defined in: src/identifier-creator.ts:85
Inherit Doc
Returns
string
Inherited from
Mixin(NonNumericIdentifierValidator, AbstractIdentifierCreator).prefix
referenceLength
Get Signature
get referenceLength():
number
Defined in: src/identifier-creator.ts:92
Inherit Doc
Returns
number
Inherited from
Mixin(NonNumericIdentifierValidator, AbstractIdentifierCreator).referenceLength
Methods
creatorFor()
protectedstaticcreatorFor(characterSet):CharacterSetCreator
Defined in: src/identifier-validator.ts:140
Get the character set creator for a character set.
Parameters
characterSet
Character set.
Returns
Character set creator.
Inherited from
Mixin(NonNumericIdentifierValidator, AbstractIdentifierCreator).creatorFor
create()
create<
TTransformerInput>(referenceOrReferences):TransformerOutput<TTransformerInput,string>
Defined in: src/non-numeric-identifier-creator.ts:76
Create identifier(s) with reference(s).
Type Parameters
TTransformerInput
TTransformerInput extends TransformerInput<string>
Transformer input type.
Parameters
referenceOrReferences
TTransformerInput
Reference(s).
Returns
TransformerOutput<TTransformerInput, string>
Identifier(s).
validate()
Validate a non-numeric identifier and throw an error if validation fails.
Param
Identifier.
Param
Validation parameters.
Call Signature
validate(
identifier,validation?):void
Defined in: src/non-numeric-identifier-validator.ts:88
Parameters
identifier
string
validation?
NonNumericIdentifierValidation
Returns
void
Inherited from
NonNumericIdentifierValidator.validate
Call Signature
validate(
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
Inherited from
NonNumericIdentifierValidator.validate
padIdentifier()
protectedpadIdentifier(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(NonNumericIdentifierValidator, AbstractIdentifierCreator).padIdentifier
validatePrefix()
protectedvalidatePrefix(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(NonNumericIdentifierValidator, AbstractIdentifierCreator).validatePrefix
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
Inherited from
Mixin(NonNumericIdentifierValidator, AbstractIdentifierCreator).init