logger.debug("debug message"); logger.info("info message"); logger.warn("warn message"); logger.error("error message"); logger.fatal("fatal message");
private static Boolean assignBool(Boolean bool, String colName, int i, CSVParser parser) throws SurveyException { HashMap<String, ArrayList<CSVEntry>> lexemes = parser.lexemes; ArrayList<CSVEntry> thisCol = lexemes.get(colName); // if this column doesn't exist, set it to be the default value if (thisCol==null || thisCol.size()==0) return defaultValues.get(colName); else { CSVEntry entry = thisCol.get(i); // if the user skipped this column, set to be the default entry if (entry.contents==null || entry.contents.equals("")) { LOGGER.warn(String.format("Supplying default entry for column %s in cell (%d,%d)" , colName , entry.lineNo , entry.colNo)); return defaultValues.get(colName); } else return parseBool(bool, colName, entry.contents, entry.lineNo, entry.colNo); } }
private void unifyBranching(Survey survey) throws SurveyException { // grab the branch column from lexemes // find the block with the corresponding blockid // put the cid and block into the for (CSVEntry entry : getNonEmptyEntryForColumn(InputOutputKeys.BRANCH)) { Question question = survey.getQuestionByLineNo(entry.lineNo); // set this question's block's branchQ equal to this question if (question.block.branchQ == null) { question.block.updateBranchParadigm(Block.BranchParadigm.ONE); question.block.branchQ = question; } else if (!question.block.branchQ.equals(question)) { question.block.updateBranchParadigm(Block.BranchParadigm.ALL); } // Set the branch destination in the question's branch map. CSVEntry option = joinOnRow(InputOutputKeys.OPTIONS, InputOutputKeys.BRANCH, entry); SurveyDatum c = question.getOptById(SurveyDatum.makeSurveyDatumId(option.lineNo, option.colNo)); Block b = allBlockLookUp.get(entry.contents); if (b == null && !entry.contents.equals("NEXT")) { SurveyException e = new SyntaxException(String.format("Branch to block (%s) at line %d matches no known block (to question error)." , entry.contents , entry.lineNo)); LOGGER.warn(e); throw e; } question.setBranchDest(c, b); } }