Interface IFixedWidthExtractorBuilder<T>

Namespace
Wolfgang.Etl.FixedWidth
Assembly
Wolfgang.Etl.FixedWidth.dll

A fluent builder for a fixed-width extraction stage of a generic Wolfgang.Etl.Abstractions.EtlPipeline. Returned by the FixedWidthExtractor source factories in EtlPipelineFixedWidthExtensions.

public interface IFixedWidthExtractorBuilder<T> : IEtlPipeline<T> where T : notnull, new()

Type Parameters

T

The record type produced by the extractor.

Inherited Members
IEtlPipeline<T>.Through<TOut>(ITransformAsync<T, TOut>)
IEtlPipeline<T>.Through<TOut>(ITransformWithCancellationAsync<T, TOut>)
IEtlPipeline<T>.To<TProgress>(LoaderBase<T, TProgress>)
Extension Methods

Remarks

Each configuration method maps one-to-one to a settable property on FixedWidthExtractor<TRecord> and returns the same builder so calls chain. Configuration is recorded and applied when the first pipeline operation — a Through stage, a sink terminator such as FixedWidthLoader, or AsAsyncEnumerable(CancellationToken) — materializes the extractor; calling a setter after that throws InvalidOperationException.

Methods

BlankLineHandling(BlankLineHandling)

Sets BlankLineHandling — how a zero-length line is handled.

IFixedWidthExtractorBuilder<T> BlankLineHandling(BlankLineHandling handling)

Parameters

handling BlankLineHandling

The blank-line policy.

Returns

IFixedWidthExtractorBuilder<T>

The same builder, for chaining.

Encoding(Encoding)

Sets the text encoding used to decode the source. Applies only to the path- and stream-based factories; a caller-supplied reader or extractor already carries its own encoding. Defaults to UTF8.

IFixedWidthExtractorBuilder<T> Encoding(Encoding encoding)

Parameters

encoding Encoding

The encoding to decode with.

Returns

IFixedWidthExtractorBuilder<T>

The same builder, for chaining.

FieldDelimiter(string?)

Sets FieldDelimiter — the delimiter present between fields in the source, or null for pure fixed-width input.

IFixedWidthExtractorBuilder<T> FieldDelimiter(string? delimiter)

Parameters

delimiter string

The field delimiter, or null for none.

Returns

IFixedWidthExtractorBuilder<T>

The same builder, for chaining.

FieldSeparator(char?)

Sets FieldSeparator — when non-null, the line after the header is treated as a separator and skipped.

IFixedWidthExtractorBuilder<T> FieldSeparator(char? separator)

Parameters

separator char?

The separator character, or null for none.

Returns

IFixedWidthExtractorBuilder<T>

The same builder, for chaining.

HasHeader(bool)

Sets HasHeader — the single-header-line convenience over HeaderLineCount(int).

IFixedWidthExtractorBuilder<T> HasHeader(bool hasHeader)

Parameters

hasHeader bool

true to skip one header line; otherwise none.

Returns

IFixedWidthExtractorBuilder<T>

The same builder, for chaining.

HeaderLineCount(int)

Sets HeaderLineCount — the number of header lines to skip before the first record.

IFixedWidthExtractorBuilder<T> HeaderLineCount(int count)

Parameters

count int

The number of leading lines to skip.

Returns

IFixedWidthExtractorBuilder<T>

The same builder, for chaining.

LineFilter(Func<string, LineAction>)

Sets LineFilter — a per-line predicate evaluated before parsing that can process, skip, or stop.

IFixedWidthExtractorBuilder<T> LineFilter(Func<string, LineAction> filter)

Parameters

filter Func<string, LineAction>

The line filter.

Returns

IFixedWidthExtractorBuilder<T>

The same builder, for chaining.

MalformedLineHandling(MalformedLineHandling)

Sets MalformedLineHandling — how a line that is too short or cannot be converted is handled.

IFixedWidthExtractorBuilder<T> MalformedLineHandling(MalformedLineHandling handling)

Parameters

handling MalformedLineHandling

The malformed-line policy.

Returns

IFixedWidthExtractorBuilder<T>

The same builder, for chaining.

RecordValidator(Func<T, ValidationResult>)

Sets RecordValidator — a per-record callback that can accept, skip, or stop after parsing.

IFixedWidthExtractorBuilder<T> RecordValidator(Func<T, ValidationResult> validator)

Parameters

validator Func<T, ValidationResult>

The record validator.

Returns

IFixedWidthExtractorBuilder<T>

The same builder, for chaining.

ValueParser(FixedWidthValueParser)

Sets ValueParser — the delegate that converts a raw field string into the target property type.

IFixedWidthExtractorBuilder<T> ValueParser(FixedWidthValueParser parser)

Parameters

parser FixedWidthValueParser

The value parser.

Returns

IFixedWidthExtractorBuilder<T>

The same builder, for chaining.