Package org.apache.commons.jelly.expression

Examples of org.apache.commons.jelly.expression.Expression


   
            // ### probably compiling this to 2 arrays might be quicker and smaller
            for (Iterator iter = attributes.entrySet().iterator(); iter.hasNext();) {
                Map.Entry entry = (Map.Entry) iter.next();
                String name = (String) entry.getKey();
                Expression expression = (Expression) entry.getValue();
   
                Object value = expression.evaluate(context);
                dynaTag.setAttribute(name, value);
            }
       
            tag.doTag(output);
        }
View Full Code Here


                    // now iterate through through the expressions
                    int size = list.getLength();
                    for (int i = 0; i < size; i++) {
                        String attributeName = list.getLocalName(i);
                        String attributeValue = list.getValue(i);
                        Expression expression =
                            taglib.createExpression(
                                getExpressionFactory(),
                                localName,
                                attributeName,
                                attributeValue);
View Full Code Here

            // now iterate through through the expressions
            int size = list.getLength();
            for (int i = 0; i < size; i++) {
                String attributeName = list.getLocalName(i);
                String attributeValue = list.getValue(i);
                Expression expression = CompositeExpression.parse(
                    attributeValue, getExpressionFactory()
                );
                script.addAttribute(attributeName, expression);
            }
            return script;
View Full Code Here

    /**
     * Adds the text to the current script block parsing any embedded
     * expressions inot ExpressionScript objects.
     */
    protected void addTextScript(String text) throws Exception {
        Expression expression =
            CompositeExpression.parse(text, getExpressionFactory());

        addExpressionScript(script, expression);
    }
View Full Code Here

                if ( attribute.isRequired() ) {
                    throw new MissingAttributeException(name);
                }
                // lets get the default value
                Object value = null;
                Expression expression = attribute.getDefaultValue();
                if ( expression != null ) {
                    value = expression.evaluate(context);
                }
               
                // only set non-null values?
                if ( value != null ) {
                    super.setAttribute(name, value);
View Full Code Here

                        // this is O(N) operation, but we don't expect there to be a lot of collisions.
                        int idx = actual.getIndex(name);
                        if(idx>=0actual.removeAttribute(idx);
                    }

                    Expression expression = e.getValue().exp;
                    actual.addAttribute("",name,name,"CDATA",expression.evaluateAsString(context));
                }

                try {
                    output.startElement(tagName,actual);
                    getTagBody().run(context,output);
View Full Code Here

TOP

Related Classes of org.apache.commons.jelly.expression.Expression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.