Class: FileDescriptor

FileDescriptor(details, headeropt, footeropt)

Descriptor representing the overall layout structure of a Fixed Width File (FWF). Contains row descriptors for details, optional header, and optional footer.

Constructor

new FileDescriptor(details, headeropt, footeropt)

Creates an instance of FileDescriptor.
Parameters:
Name Type Attributes Default Description
details Array.<DetailRowDescriptor> Array of detail row descriptors.
header HeaderRowDescriptor | null <optional>
null Optional header row descriptor.
footer FooterRowDescriptor | null <optional>
null Optional footer row descriptor.
Source:
Throws:
  • If details is not an Array or elements are not DetailRowDescriptor.
    Type
    TypeError
  • If details array is empty or row line sizes do not match.
    Type
    Error
Example
const detail = new DetailRowDescriptor([new CharColumn('name', 20)]);
const fileDesc = new FileDescriptor([detail]);

Classes

FileDescriptor

Members

details :Array.<DetailRowDescriptor>

Array of detail row descriptors.
Type:
Source:
Optional footer row descriptor.
Type:
Source:
Optional header row descriptor.
Type:
Source:

lineSize :number

Expected total line size width in characters across all row descriptors.
Type:
  • number
Source:

Methods

validateLineSizes()

Validates that all row descriptors (details, header, and footer) have matching line sizes.
Source:
Throws:
If line sizes differ across row descriptors.
Type
Error