public AttributeKey toAttributeKey() { return new AttributeKey(namespace, attribute); }
public boolean hasAttribute(String namespace, String attributeName) { AttributeKey key = new AttributeKey(namespace, attributeName); return attributes.containsKey(key); }
public Attribute getAttribute(String namespace, String attributeName) { return attributes.get(new AttributeKey(namespace, attributeName)); }
public boolean hasAttribute(String attributeName) { AttributeKey key = new AttributeKey(null, attributeName); return attributes.containsKey(key); }
public Attribute getAttribute(String attributeName) { return attributes.get(new AttributeKey(null, attributeName)); }
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 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 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); } };
public Tag addAttribute(Attribute a) { if (attributes == null) { attributes = new HashMap<AttributeKey, Attribute>(); } AttributeKey key = new AttributeKey(a.getAttributeNameSpace(), a.getAttributeName()); attributes.put(key, a); if ("id".equals(a.getAttributeName())) { id = a.getValue(); } Cambridge bindings = Cambridge.getInstance(); tagParts.add(a); if (a.isDynamic()) { DynamicAttributeKey attributeKey = new DynamicAttributeKey(a.getNamespaceUri(), a.getAttributeNameSpace(), a.getAttributeName()); if (bindings.getStaticBehavior(attributeKey) == null) { dynamic = true; } } return this; }
if (sb != null) { sb.modify(doc, a.getValue(), this); staticAttributes.add(new AttributeKey(a.getAttributeNameSpace(), a.getAttributeName())); if (sb.shouldRemove()) { remove = true;
if (sb != null) { sb.modify(doc, a.getValue(), this); staticAttributes.add(new AttributeKey(a.getAttributeNameSpace(), a.getAttributeName())); if (sb.shouldRemove()) { remove = true;