in src/main/java/com/univocity/parsers/fixed/FixedWidthWriter.java [149:189]
protected final void initialize(FixedWidthWriterSettings settings) {
FixedWidthFormat format = settings.getFormat();
this.padding = format.getPadding();
this.defaultPadding = padding;
this.ignoreLeading = settings.getIgnoreLeadingWhitespaces();
this.ignoreTrailing = settings.getIgnoreTrailingWhitespaces();
this.fieldLengths = settings.getAllLengths();
this.fieldAlignments = settings.getFieldAlignments();
this.fieldPaddings = settings.getFieldPaddings();
this.ignore = settings.getFieldsToIgnore();
if (ignore != null) {
for (int i = 0; i < ignore.length; i++) {
if (ignore[i]) {
ignoreCount++;
}
}
}
this.lookaheadFormats = settings.getLookaheadFormats();
this.lookbehindFormats = settings.getLookbehindFormats();
this.defaultHeaderPadding = settings.getUseDefaultPaddingForHeaders();
this.defaultHeaderAlignment = settings.getDefaultAlignmentForHeaders();
super.enableNewlineAfterRecord(settings.getWriteLineSeparatorAfterRecord());
if (lookaheadFormats != null || lookbehindFormats != null) {
lookupChars = new char[Lookup.calculateMaxLookupLength(lookaheadFormats, lookbehindFormats)];
rootLengths = fieldLengths;
rootAlignments = fieldAlignments;
rootPaddings = fieldPaddings;
rootIgnore = ignore;
} else {
lookupChars = null;
rootLengths = null;
rootAlignments = null;
rootPaddings = null;
rootIgnore = null;
}
}