Class FileDescriptor
java.lang.Object
io.github.kelsoncm.fwf.descriptors.FileDescriptor
Descriptor representing the layout structure of a Fixed Width File.
Contains details, optional header, and optional footer descriptors. Validates that line sizes across all sections are equal.
-
Constructor Summary
ConstructorsConstructorDescriptionFileDescriptor(List<DetailRowDescriptor> details) Constructs a newFileDescriptorwith detail descriptors only.FileDescriptor(List<DetailRowDescriptor> details, HeaderRowDescriptor header) Constructs a newFileDescriptorwith detail and header descriptors.FileDescriptor(List<DetailRowDescriptor> details, HeaderRowDescriptor header, FooterRowDescriptor footer) Constructs a newFileDescriptorwith detail, header, and footer descriptors. -
Method Summary
Modifier and TypeMethodDescriptionGets the list of detail row descriptors.Gets the footer row descriptor.Gets the header row descriptor.intGets the expected line size (in characters) for the file.
-
Constructor Details
-
FileDescriptor
Constructs a newFileDescriptorwith detail and header descriptors.- Parameters:
details- list ofDetailRowDescriptorinstancesheader- optionalHeaderRowDescriptor
-
FileDescriptor
Constructs a newFileDescriptorwith detail descriptors only.- Parameters:
details- list ofDetailRowDescriptorinstances
-
Method Details
-
getDetails
Gets the list of detail row descriptors.- Returns:
- unmodifiable list of detail descriptors
-
getHeader
Gets the header row descriptor.- Returns:
- header descriptor or null if not present
-
getLineSize
public int getLineSize()Gets the expected line size (in characters) for the file.- Returns:
- line size in characters
-