Table of Contents

Class FixedLengthFieldAttribute

Namespace
NuvTools.Report.FixedLength.Attributes
Assembly
NuvTools.Report.dll

Maps a property to a fixed-length field by sequential position and character width.

[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public sealed class FixedLengthFieldAttribute : Attribute
Inheritance
FixedLengthFieldAttribute
Inherited Members

Constructors

FixedLengthFieldAttribute(int, int)

Initializes a new instance of FixedLengthFieldAttribute with the specified order and character width.

public FixedLengthFieldAttribute(int order, int length)

Parameters

order int

The zero-based sequential position of the field.

length int

The character width of the field.

Properties

Converter

Gets or sets the type of an IFieldConverter implementation used to convert the raw string value.

public Type? Converter { get; set; }

Property Value

Type

Format

Gets or sets a format string passed to the converter (e.g. "yyyyMMdd" for dates, or precision for decimals).

public string? Format { get; set; }

Property Value

string

Length

Gets the character width of the field.

public int Length { get; }

Property Value

int

Optional

Gets or sets whether the field is optional (skipped if the line is too short). Defaults to false.

public bool Optional { get; set; }

Property Value

bool

Order

Gets the zero-based sequential position of the field in the record.

public int Order { get; }

Property Value

int

Trim

Gets or sets the trim mode applied to the raw field value before conversion. Defaults to None.

public TrimMode Trim { get; set; }

Property Value

TrimMode