
br.com.objectos.jabuticava.serasa.relato.factoring.HeaderProcessadoParser Maven / Gradle / Ivy
The newest version!
package br.com.objectos.jabuticava.serasa.relato.factoring;
import br.com.objectos.way.io.flat.ComparisonOperator;
import br.com.objectos.way.io.flat.FlatFileReader;
import br.com.objectos.way.io.flat.Record;
import br.com.objectos.way.io.flat.RecordMatcher;
import br.com.objectos.way.io.flat.RecordParseException;
import br.com.objectos.way.io.flat.RecordParser;
import javax.annotation.Generated;
@Generated("br.com.objectos.way.io.flat.FlatRecordPlugin")
final class HeaderProcessadoParser implements RecordMatcher, RecordParser {
private static final HeaderProcessadoParser INSTANCE = new HeaderProcessadoParser();
private static final String id = "00";
private HeaderProcessadoParser() {
}
public static RecordParser get() {
return INSTANCE;
}
public static RecordMatcher getMatcher() {
return INSTANCE;
}
@Override
public boolean matches(String line) {
return line != null ? line.startsWith("00") : false;
}
@Override
public HeaderProcessado parse(FlatFileReader file) throws RecordParseException {
Record record = file.recordReader()
.fixed(id)
.text(128)
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.integer(3, ComparisonOperator.EQ.value(0), " ")
.read();
if (!record.valid()) {
throw record.parseException();
}
return new HeaderProcessadoBuilderPojo()
.registro(record. get())
.erro00(record.intValue())
.erro01(record.intValue())
.erro02(record.intValue())
.erro03(record.intValue())
.erro04(record.intValue())
.erro05(record.intValue())
.erro06(record.intValue())
.erro07(record.intValue())
.erro08(record.intValue())
.erro09(record.intValue())
.erro10(record.intValue())
.erro11(record.intValue())
.erro12(record.intValue())
.erro13(record.intValue())
.erro14(record.intValue())
.erro15(record.intValue())
.erro16(record.intValue())
.erro17(record.intValue())
.erro18(record.intValue())
.erro19(record.intValue())
.build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy