@Override public void addAttribute(String name, String prefix, String nsURI, Expression expression) { allAttributesAreConstant &= expression instanceof ConstantExpression; super.addAttribute(name, prefix, nsURI, expression); }
@Override public void addAttribute(String name, String prefix, String nsURI, Expression expression) { allAttributesAreConstant &= expression instanceof ConstantExpression; super.addAttribute(name, prefix, nsURI, expression); }
@Override public void addAttribute(String name, Expression expression) { allAttributesAreConstant &= expression instanceof ConstantExpression; super.addAttribute(name, expression); }
@Override public void addAttribute(String name, Expression expression) { allAttributesAreConstant &= expression instanceof ConstantExpression; super.addAttribute(name, expression); }
protected void configureStaticTagAttributes(TagScript script, Attributes list) throws JellyException { // now iterate through through the expressions int size = list.getLength(); for (int i = 0; i < size; i++) { String attributeValue = list.getValue(i); Expression expression = CompositeExpression.parse( attributeValue, getExpressionFactory() ); String attrQName = list.getQName(i); int p = attrQName.indexOf(':'); String prefix = p>=0 ? attrQName.substring(0,p): ""; script.addAttribute(list.getLocalName(i), prefix, list.getURI(i), expression); } }
protected void configureStaticTagAttributes(TagScript script, Attributes list) throws JellyException { // now iterate through through the expressions int size = list.getLength(); for (int i = 0; i < size; i++) { String attributeValue = list.getValue(i); Expression expression = CompositeExpression.parse( attributeValue, getExpressionFactory() ); String attrQName = list.getQName(i); int p = attrQName.indexOf(':'); String prefix = p>=0 ? attrQName.substring(0,p): ""; script.addAttribute(list.getLocalName(i), prefix, list.getURI(i), expression); } }
protected void configureStaticTagAttributes(TagScript script, Attributes list) throws JellyException { // now iterate through through the expressions int size = list.getLength(); for (int i = 0; i < size; i++) { String attributeValue = list.getValue(i); Expression expression = CompositeExpression.parse( attributeValue, getExpressionFactory() ); String attrQName = list.getQName(i); int p = attrQName.indexOf(':'); String prefix = p>=0 ? attrQName.substring(0,p): ""; script.addAttribute(list.getLocalName(i), prefix, list.getURI(i), expression); } }
/** * Create a tag script if the given QName is a taglib invocation, or return null * to handle it like a literal static tag. */ private TagScript createTagScript(QName n, Map<?, ?> attributes) throws JellyException { TagLibrary lib = context.getTagLibrary(n.getNamespaceURI()); if(lib!=null) { String localName = n.getLocalPart(); TagScript tagScript = lib.createTagScript(localName, null/*this parameter appears to be unused.*/); if (tagScript==null) tagScript = lib.createTagScript(localName.replace('_','-'), null); if (tagScript!=null) { if (attributes != null) { for (Entry e : attributes.entrySet()) { Object v = e.getValue(); if (v!=null) tagScript.addAttribute(e.getKey().toString(), new ConstantExpression(v)); } } return tagScript; } } // otherwise treat it as a literal. return null; }
tagScript.addAttribute(e.getKey().asJavaString(), new ConstantExpression(e.getValue()));
expression = createConstantExpression(localName, attributeName, attributeValue); script.addAttribute(attributeName, expression);
expression = createConstantExpression(localName, attributeName, attributeValue); script.addAttribute(attributeName, expression);
expression = createConstantExpression(localName, attributeName, attributeValue); script.addAttribute(attributeName, expression);
expression = createConstantExpression(localName, attributeName, attributeValue); script.addAttribute(attributeName, expression);