/** * Returns the sequence of fields whose padding character must/must not be retained in the parsed value * @return the sequence that have an explicit 'keepPadding' flag. */ Boolean[] getKeepPaddingFlags() { if (fieldLengths == null) { return null; } Boolean[] keepFlags = fieldLengths.getKeepPaddingFlags(); Boolean[] out = new Boolean[keepFlags.length]; Arrays.fill(out, getKeepPadding()); for (int i = 0; i < keepFlags.length; i++) { Boolean flag = keepFlags[i]; if (flag != null) { out[i] = flag; } } return out; }
Lookup(String value, FixedWidthFields config, FixedWidthFormat format) { this.value = value.toCharArray(); this.lengths = config.getAllLengths(); this.alignments = config.getFieldAlignments(); this.fieldNames = config.getFieldNames(); this.paddings = config.getFieldPaddings(format); this.wildcard = format.getLookupWildcard(); this.ignore = config.getFieldsToIgnore(); this.keepPaddingFlags = config.getKeepPaddingFlags(); }