public ElseIfBehavior get(DynamicAttribute keyAttribute, Map<AttributeKey, Attribute> attributes, int line, int col) throws ExpressionParsingException { return new ElseIfBehavior(keyAttribute.getExpression(), line, col); } };
public FromBehavior get(DynamicAttribute keyAttribute, Map<AttributeKey, Attribute> attributes, int line, int col) throws ExpressionParsingException, BehaviorInstantiationException { Expression from = keyAttribute.getExpression(); AttributeKey toKey = new AttributeKey(keyAttribute.getAttributeNameSpace(), "to"); Attribute toAttribute = attributes.get(toKey); if (toAttribute == null || !(toAttribute instanceof DynamicAttribute)) { throw new BehaviorInstantiationException("Required parameters to is not set", line, col); } Expression to = ((DynamicAttribute) toAttribute).getExpression(); return new FromBehavior(from, to, line, col); } };
element = new StaticAttribute(namespaceUri, tok.getLineNo(), tok.getColumn()); } else { element = new DynamicAttribute(namespaceUri, tok.getLineNo(), tok.getColumn()); ((StaticAttribute) element).setValue(currentToken.value); } else { ((DynamicAttribute) element).setValue(currentToken.value, expressionLanguage.parse(currentToken.value, currentToken.getLineNo(), currentToken.getColumn()));
public RepeatBehavior get(DynamicAttribute keyAttribute, Map<AttributeKey, Attribute> attributes, int line, int col) throws ExpressionParsingException, BehaviorInstantiationException { Expression number = keyAttribute.getExpression(); return new RepeatBehavior(number, line, col); } };
public WithBehavior get(DynamicAttribute keyAttribute, Map<AttributeKey, Attribute> attributes, int line, int col) throws ExpressionParsingException, BehaviorInstantiationException { AttributeKey asKey = new AttributeKey(keyAttribute.getAttributeNameSpace(), "as"); Attribute asAttribute = attributes.get(asKey); return new WithBehavior(keyAttribute.getExpression(), asAttribute == null ? null : asAttribute.getValue(), line, col); } };
public WhileBehavior get(DynamicAttribute keyAttribute, Map<AttributeKey, Attribute> attributes, int line, int col) throws ExpressionParsingException, BehaviorInstantiationException { return new WhileBehavior(keyAttribute.getExpression(), line, col); } };
public ForeachBehavior get(DynamicAttribute keyAttribute, Map<AttributeKey, Attribute> attributes, int line, int col) throws ExpressionParsingException, BehaviorInstantiationException { AttributeKey asKey = new AttributeKey(keyAttribute.getAttributeNameSpace(), "as"); Attribute asAttribute = attributes.get(asKey); AttributeKey iterKey = new AttributeKey(keyAttribute.getAttributeNameSpace(), "iter"); Attribute iterAttribute = attributes.get(iterKey); Expression e = keyAttribute.getExpression(); return new ForeachBehavior(e, asAttribute == null ? null : asAttribute.getValue(), iterAttribute == null ? null : iterAttribute.getValue(), line, col); } };
public ConditionalAttributeBehavior get(DynamicAttribute keyAttribute, Map<AttributeKey, Attribute> attributes, int line, int col) throws ExpressionParsingException, BehaviorInstantiationException { return new ConditionalAttributeBehavior(keyAttribute.getExpression(), keyAttribute, line, col); } };
public SelectedBehavior get(DynamicAttribute keyAttribute, Map<AttributeKey, Attribute> attributes, int line, int col) throws ExpressionParsingException, BehaviorInstantiationException { return new SelectedBehavior(keyAttribute.getExpression(), line, col); } };
public IfBehavior get(DynamicAttribute keyAttribute, Map<AttributeKey, Attribute> attributes, int line, int col) throws ExpressionParsingException { return new IfBehavior(keyAttribute.getExpression(), line, col); } };
@Override public void init() throws TemplateParsingException { Attribute a = getAttribute(nameSpace, "form"); if (!(a instanceof DynamicAttribute)) { throw new TemplateParsingException("The required attribute form for form element is not specified", getBeginLine(), getBeginColumn()); } DynamicAttribute form = (DynamicAttribute) a; try { formExpression = form.getExpression(); } catch (ExpressionParsingException e) { throw new TemplateParsingException("Error parsing expression for form tag", e, getBeginLine(), getBeginColumn()); } }