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
orderintThe zero-based sequential position of the field.
lengthintThe 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
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
Length
Gets the character width of the field.
public int Length { get; }
Property Value
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
Order
Gets the zero-based sequential position of the field in the record.
public int Order { get; }
Property Value
Trim
Gets or sets the trim mode applied to the raw field value before conversion. Defaults to None.
public TrimMode Trim { get; set; }