@Test public void testIfBlock() throws IOException { String qlForm = "form taxOfficeExample { if (hasSoldHouse) { \"q1?\" val1: boolean } }"; Form form = ASTGenerator.getForm(qlForm); List<Item> questions = form.getQuestions(); IfThen ifThen = (IfThen) questions.get(0); assertEquals("taxOfficeExample", form.getFormId()); assertEquals(1, ifThen.getThenStatements().size()); }
public List<Item> getThenStatements() { return thenStatements; }
IfThen extends Item { public List<Item> getThenStatements() { return thenStatements; } }
IfThen extends Item { public List<Item> getThenStatements() { return thenStatements; } IfThen(int lineNumber, Expression condition, List<Item> thenStatements); }
IfThen extends Item { public List<Item> getThenStatements() { return thenStatements; } IfThen(int lineNumber, Expression condition, List<Item> thenStatements); Expression getCondition(); List<Item> getThenStatements(); @Override T accept(ItemVisitor<T> visitor); }
IfThen extends Item { public List<Item> getThenStatements() { return thenStatements; } IfThen(int lineNumber, Expression condition, List<Item> thenStatements); Expression getCondition(); List<Item> getThenStatements(); @Override T accept(ItemVisitor<T> visitor);  }