Class Code128GS1Parser
GS1 Code128 parser that handles all GS1 Application Identifiers, validates data content, and provides comprehensive error handling. Supports multiple input formats and provides detailed parsing results.
Inheritance
Namespace: IronBarCode
Assembly: IronBarCode.dll
Syntax
public static class Code128GS1Parser : Object
Methods
ExtractElements(String)
Extracts all GS1 elements from a string.
Declaration
public static List<ParsedElement> ExtractElements(string input)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | input | The GS1 string to parse. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<ParsedElement> | List of parsed GS1 elements. |
Exceptions
| Type | Condition |
|---|---|
| IronBarCodeParsingException | Thrown when the input cannot be parsed successfully due to validation errors. |
Format(String)
Formats a GS1 string
Declaration
public static string Format(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The GS1 string to format. |
Returns
| Type | Description |
|---|---|
| System.String | Formatted GS1 string with parentheses. |
Remarks
This method throws an exception if the input is invalid.
Exceptions
| Type | Condition |
|---|---|
| IronBarCodeParsingException | Thrown when the input cannot be parsed successfully due to validation errors. |
IsValid(String)
Validates if a string is a valid GS1 format
Declaration
public static bool IsValid(string input)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | input | The string to validate. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if valid GS1 format; false otherwise. |
Parse(String)
Parses and formats a GS1 string, handling multiple input formats and providing comprehensive validation.
Declaration
public static ParseResult Parse(string input)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | input | The GS1 string to parse (raw, formatted, or mixed). |
Returns
| Type | Description |
|---|---|
| ParseResult | ParseResult containing formatted string, elements, and validation results. |
Remarks
This method validates the GS1 structure and data content. If any validation errors occur, an IronBarCodeParsingException will be thrown with details about the specific errors.
Exceptions
| Type | Condition |
|---|---|
| IronBarCodeParsingException | Thrown when the input cannot be parsed successfully due to validation errors. The exception contains detailed information about all parsing errors encountered. |