@Test public void testWithBehavior() throws Exception { TemplateTokenizer tokenizer = new TemplateTokenizer(ConditionalAttributeBehaviorTest.class.getResourceAsStream("withbehavior.html")); TemplateParser parser = new TemplateParser(tokenizer, Expressions.cambridgeExpressionLanguage); ExpressionContext context = new MapExpressionContext(); User user = new User("test", "test@test.com"); context.put("user", user); TemplateDocument t = parser.parse(); assertNotNull(t); FragmentList fragments = t.normalize(); StringWriter builder = new StringWriter(); for (Fragment f : fragments) { f.eval(context, builder); } assertEquals(out, builder.toString()); }
public WithBehavior(Expression expression, String currentObjectName, int line, int col) { super(line, col); this.expression = expression; this.currentObjectName = currentObjectName; }
WithBehavior extends LoopingTagBehavior { public WithBehavior(Expression expression, String currentObjectName, int line, int col) { super(line, col); this.expression = expression; this.currentObjectName = currentObjectName; } }
WithBehavior extends LoopingTagBehavior { public WithBehavior(Expression expression, String currentObjectName, int line, int col) { super(line, col); this.expression = expression; this.currentObjectName = currentObjectName; } WithBehavior(Expression expression, String currentObjectName, int line, int col); }
WithBehavior extends LoopingTagBehavior { public WithBehavior(Expression expression, String currentObjectName, int line, int col) { super(line, col); this.expression = expression; this.currentObjectName = currentObjectName; } WithBehavior(Expression expression, String currentObjectName, int line, int col); @Override String getCurrentObjectName(); static BehaviorProvider<WithBehavior> getProvider(); }
WithBehavior extends LoopingTagBehavior { public WithBehavior(Expression expression, String currentObjectName, int line, int col) { super(line, col); this.expression = expression; this.currentObjectName = currentObjectName; } WithBehavior(Expression expression, String currentObjectName, int line, int col); @Override String getCurrentObjectName(); static BehaviorProvider<WithBehavior> getProvider();  }