private Interpreter interpreterFor(Tables paramTable, Fixture fixture) throws Exception { String interpreterCalled = paramTable.firstChild().firstChild().at(0).getContent(); if ("setup".equals(interpreterCalled)) { return new SetupInterpreter(fixture); } else if ("rule for".equals(interpreterCalled)) { return new DecisionTableInterpreter(fixture); } else if ("decision table".equals(interpreterCalled)) { return new DecisionTableInterpreter(fixture); } // TODO find Exception throw new Exception("No interpreter found"); }
public static Rows parse(String markup) { Tables table = new Tables(); String[] rows = markup.split("\\n"); for (String cells : rows) { if (StringUtils.isBlank(cells)) { continue; } Rows row = ( Rows ) table.addChild(); if ( ! isRowEmpty(cells)) { row.addChild(Cells.parse(cells)); } } return ( Rows ) table.firstChild(); }
public AnnotationTable annotations() { ListOfInterpreter listOf = new ListOfInterpreter(new PlainOldFixture(this)); Rows rows = new Rows("to string"); rows.addSibling(tables.firstChild()); listOf.execute(rows); return new AnnotationTable(tables); } }
public AnnotationTable annotations() { SetOfInterpreter setOf = new SetOfInterpreter(new PlainOldFixture(this)); Rows rows = new Rows("to string"); rows.addSibling(tables.firstChild()); setOf.execute(rows); return new AnnotationTable(tables); }
public AnnotationTable annotations() { SetOfInterpreter setOf = new SetOfInterpreter(new PlainOldFixture(this)); Rows rows = new Rows("first", "last"); rows.addSibling(tables.firstChild()); setOf.execute(rows); return new AnnotationTable(tables); }
public AnnotationTable annotations() { SupersetOfInterpreter supersetOf = new SupersetOfInterpreter(new PlainOldFixture(this)); Rows rows = new Rows("to string"); rows.addSibling(tables.firstChild()); supersetOf.execute(rows); return new AnnotationTable(tables); }
public AnnotationTable annotations() { SubsetOfInterpreter subsetOf = new SubsetOfInterpreter(new PlainOldFixture(this)); Rows rows = new Rows("to string"); rows.addSibling(tables.firstChild()); subsetOf.execute(rows); return new AnnotationTable(tables); }