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); } };
e.printStackTrace(); throw new TemplateReloadingException(e);
private void assignBehaviors() throws BehaviorInstantiationException { Cambridge bindings = Cambridge.getInstance(); if (attributes != null) { for (Attribute a : attributes.values()) { if (a.isDynamic()) { DynamicAttributeKey key = new DynamicAttributeKey(a.getNamespaceUri(), a.getAttributeNameSpace(), a.getAttributeName()); TagBehavior behavior; try { behavior = bindings.getBehavior(key, attributes, a.getLine(), a.getColumn()); } catch (ExpressionParsingException e) { throw new BehaviorInstantiationException("Error in parsing expression", e, getBeginLine(), getBeginColumn()); } if (behavior != null) { addBehavior(behavior); } } } } }