AIDC Toolkit / GS1 / SerializableNumericIdentifierValidator
Class: SerializableNumericIdentifierValidator
Defined in: src/serializable-numeric-identifier-validator.ts:20
Serializable numeric identifier validator. Validates both serialized and non-serialized forms of numeric identifiers that support serialization.
Extends
Constructors
Constructor
new SerializableNumericIdentifierValidator(
identifierType,length,serialComponentLength,serialComponentCharacterSet):SerializableNumericIdentifierValidator
Defined in: src/serializable-numeric-identifier-validator.ts:56
Constructor.
Parameters
identifierType
Identifier type.
length
number
Length.
serialComponentLength
number
Serial component length.
serialComponentCharacterSet
Serial component character set.
Returns
SerializableNumericIdentifierValidator
Overrides
NonGTINNumericIdentifierValidator.constructor
Accessors
serialComponentLength
Get Signature
get serialComponentLength():
number
Defined in: src/serializable-numeric-identifier-validator.ts:74
Get the serial component length.
Returns
number
serialComponentCharacterSet
Get Signature
get serialComponentCharacterSet():
ContentCharacterSet
Defined in: src/serializable-numeric-identifier-validator.ts:81
Get the serial component character set.
Returns
serialComponentValidation
Get Signature
get
protectedserialComponentValidation():CharacterSetValidation
Defined in: src/serializable-numeric-identifier-validator.ts:88
Get the serial component validation parameters.
Returns
serialComponentCreator
Get Signature
get serialComponentCreator():
CharacterSetCreator
Defined in: src/serializable-numeric-identifier-validator.ts:95
Get the serial component creator.
Returns
leaderType
Get Signature
get leaderType():
string
Defined in: src/numeric-identifier-validator.ts:100
Get the leader type.
Returns
string
Inherited from
NonGTINNumericIdentifierValidator.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
Inherited from
NonGTINNumericIdentifierValidator.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
Inherited from
NonGTINNumericIdentifierValidator.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
NonGTINNumericIdentifierValidator.length
referenceCharacterSet
Get Signature
get referenceCharacterSet():
ContentCharacterSet
Defined in: src/identifier-validator.ts:191
Get the reference character set.
Returns
Inherited from
NonGTINNumericIdentifierValidator.referenceCharacterSet
referenceCreator
Get Signature
get referenceCreator():
CharacterSetCreator
Defined in: src/identifier-validator.ts:198
Get the reference creator.
Returns
Inherited from
NonGTINNumericIdentifierValidator.referenceCreator
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
NonGTINNumericIdentifierValidator.creatorFor
validate()
validate(
identifier,validation?):void
Defined in: src/serializable-numeric-identifier-validator.ts:102
Validate an identifier and throw an error if validation fails.
Parameters
identifier
string
Identifier.
validation?
Identifier validation parameters.
Returns
void
Overrides
NonGTINNumericIdentifierValidator.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
NonGTINNumericIdentifierValidator.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