public FunctionExpression(String functionName) { this.functionName = functionName; runner = Cambridge.getInstance().getFunctionRunner(functionName); }
private String getNamespaceUri(String name) { if (name == null) { return null; } if (namespaceMappings != null) { String uri = namespaceMappings.get(name); if (uri != null) { return uri; } } return Cambridge.getInstance().getDefaultNamespace(name); }
public void setFilters(ArrayList<String> f) { filters = new ArrayList<Filter>(); for (String s : f) { String name; String params; int i = s.indexOf(':'); if (i != -1) { name = s.substring(0, i); params = s.substring(i + 1).trim(); } else { name = s; params = null; } Filter filter = Cambridge.getInstance().getFilter(name, line, col); if (filter != null) { filter.init(params); filters.add(filter); } } if (filters.size() == 0) { filters = null; } }
public void setFilters(ArrayList<String> f) { filters = new ArrayList<Filter>(); for (String s : f) { String name; String params; int i = s.indexOf(':'); if (i != -1) { name = s.substring(0, i); params = s.substring(i + 1).trim(); } else { name = s; params = null; } Filter filter = Cambridge.getInstance().getFilter(name, getBeginLine(), getBeginColumn()); if (filter != null) { filter.init(params); filters.add(filter); } } if (filters.size() == 0) { filters = null; } }
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; }
"</div>"; Cambridge.getInstance().bindTag(Cambridge.DefaultNamespaceURI, "form").toProvider(new FormTagProvider());
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); } } } } }
@Override void normalize(TemplateDocument doc, FragmentList f) throws BehaviorInstantiationException { if (attributes != null) { Cambridge bindings = Cambridge.getInstance(); boolean remove = false; HashSet<AttributeKey> staticAttributes = new HashSet<AttributeKey>();
} else { if (attributes != null) { Cambridge bindings = Cambridge.getInstance(); boolean remove = false; HashSet<AttributeKey> staticAttributes = new HashSet<AttributeKey>();
private TagNode tag() throws IOException, TemplateParsingException { OpenTagToken token = (OpenTagToken) currentToken; Cambridge bindings = Cambridge.getInstance();