}
public void processFile(File file, ReportType reportType) {
logger.info("Processing file: " + file.getAbsolutePath() + " of type " + reportType);
LbdcFile lbdcFile = null;
switch(reportType) {
case BILL_HTML:
lbdcFile = new LbdcFileHtml(file);
break;
case MEMO:
lbdcFile = new LbdcFileMemo(file);
break;
case PAGING:
lbdcFile = new LbdcFilePaging(file);
}
FieldName[] fieldNames = new FieldName[0];
AssociatedFields associatedFields = lbdcFile.getClass().getAnnotation(AssociatedFields.class);
if(associatedFields != null) {
fieldNames = associatedFields.value();
}
ArrayList<ProblemBill> problemBills = lbdcFile.getProblemBills(fieldNames);
logger.info("Found " + problemBills.size() + " problematic bills");
pbr.createOrUpdateProblemBills(problemBills, true);
pbr.deleteNonProblemBills();