GS1Codetext

GS1Codetext class

Represents GS1 codetext for encoding and decoding as an ordered sequence of
Application Identifier elements. Source order and repeated Application Identifiers
are preserved. The bracketed representation has the form (AI)value(AI)value.
A literal opening parenthesis ‘(’ inside a value must be written as (; this is the
only supported escape sequence. A closing parenthesis ‘)’ inside a value does not
require escaping.

The GS1Codetext type exposes the following members:

Constructors

NameDescription
GS1Codetext()Initializes a new instance of the GS1Codetext class

Properties

NameDescription
barcode_typeGets or sets the barcode type used to encode this GS1 codetext.
Supported types are GS1Aztec, GS1CodablockF, GS1Code128, GS1DataMatrix,
GS1DotCode, GS1HanXin, GS1MicroPdf417, GS1QR and GS1 DataBar types.
The default value is GS1Code128.
countGets the number of Application Identifier elements.
elementsGets a copy of all elements in source order.

Indexer

NameDescription
[index]Gets an element by its position in the ordered sequence.

Methods

NameDescription
get_first(application_identifier)Gets the first value for an Application Identifier.
get_all(application_identifier)Gets all values for an Application Identifier in source order.
add(application_identifier, value)Appends a validated Application Identifier element.
validate(value)Validates a bracketed GS1 element string in the form (AI)value(AI)value without
constructing an object. A literal ‘(’ inside a value must be written as (; no
other escape sequence is supported, and ‘)’ does not require escaping.
parse(value)Parses a bracketed GS1 element string in the form (AI)value(AI)value. A literal
‘(’ inside a value must be written as (; no other escape sequence is supported,
and ‘)’ does not require escaping.
try_parse(value, result, validation_result)Attempts to parse a bracketed GS1 element string in the form (AI)value(AI)value
and returns structured validation errors. A literal ‘(’ inside a value must be
written as (; no other escape sequence is supported, and ‘)’ does not require
escaping.
get_constructed_codetext()Constructs the bracketed GS1 codetext in the form (AI)value(AI)value.
Literal opening parentheses in values are escaped as (.
init_from_string(constructed_codetext)Initializes this instance from bracketed GS1 codetext in the form (AI)value(AI)value.
Existing elements are replaced only after the supplied codetext has been parsed successfully.
get_barcode_type()Gets the barcode type used to encode this GS1 codetext.

See Also