Class IdentifierDefinition
Base class for defining identifiers in structured data formats, including validation rules.
Inheritance
System.Object
IdentifierDefinition
Namespace: IronBarCode
Assembly: IronBarCode.dll
Syntax
public class IdentifierDefinition : Object
Constructors
IdentifierDefinition(String, Int32, String, String, Func<String, ValidationResult>)
Initializes a new instance of the IdentifierDefinition class.
Declaration
public IdentifierDefinition(string identifier, int length, string description, string format, Func<string, ValidationResult> validator = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | identifier | The identifier string. |
System.Int32 | length | The length of the data (negative for variable length). |
System.String | description | Description of the identifier. |
System.String | format | Expected format of the data. |
System.Func<System.String, ValidationResult> | validator | Optional validator function. Uses default validator if null. |
Properties
Description
Description of the identifier.
Declaration
public string Description { get; }
Property Value
Type | Description |
---|---|
System.String |
Format
Expected format of the data.
Declaration
public string Format { get; }
Property Value
Type | Description |
---|---|
System.String |
Identifier
Identifier string that this definition represents.
Declaration
public string Identifier { get; }
Property Value
Type | Description |
---|---|
System.String |
IsVariableLength
Gets a value indicating whether this identifier represents variable-length data.
Declaration
public bool IsVariableLength { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Length
Length of the data element. Negative values indicate variable length.
Declaration
public int Length { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
MaxLength
Maximum length of the data (absolute value of Length property).
Declaration
public int MaxLength { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Validator
Validator function for this identifier.
Declaration
public Func<string, ValidationResult> Validator { get; }
Property Value
Type | Description |
---|---|
System.Func<System.String, ValidationResult> |