Package org.apache.tiles

Examples of org.apache.tiles.Expression


        Attribute nuattr;
        nuattr = new Attribute();

        nuattr.setRole(replace(attr.getRole(), vars));
        nuattr.setRenderer(attr.getRenderer());
        Expression expressionObject = attr.getExpressionObject();
        if (expressionObject != null) {
            Expression newExpressionObject = Expression
                    .createExpression(replace(expressionObject.getExpression(), vars), expressionObject.getLanguage());
            nuattr.setExpressionObject(newExpressionObject);
        }

        Object value = attr.getValue();
View Full Code Here


     */
    @Test
    public void testReplacePlaceholdersEL_0() {
        Map<String, Attribute> attributes = new HashMap<String, Attribute>();
        Attribute attribute = new Attribute("some-{1}-${requestScope.someVariable}.jsp");
        attribute.setExpressionObject(new Expression((String)attribute.getValue()));
        attributes.put("something", attribute);
        Definition definition = new Definition("definitionName", new Attribute("template"), attributes);
        Definition nudef = PatternUtil.replacePlaceholders(definition, "nudef", "value0", "value1", "value2", "value3");
        assertEquals("nudef", nudef.getName());

View Full Code Here

     */
    @Test
    public void testReplacePlaceholdersEL_1() {
        Map<String, Attribute> attributes = new HashMap<String, Attribute>();
        Attribute attribute = new Attribute("some-{1}-${requestScope.someVariable}-other-{2}.jsp");
        attribute.setExpressionObject(new Expression((String)attribute.getValue()));
        attributes.put("something", attribute);
        Definition definition = new Definition("definitionName", new Attribute("template"), attributes);
        Definition nudef = PatternUtil.replacePlaceholders(definition, "nudef", "value0", "value1", "value2", "value3");
        assertEquals("nudef", nudef.getName());

View Full Code Here

     */
    @Test
    public void testReplacePlaceholdersEL_2() {
        Map<String, Attribute> attributes = new HashMap<String, Attribute>();
        Attribute attribute = new Attribute("some-${requestScope.someVariable}-other-{1}-${requestScope.someOtherVariable}.jsp");
        attribute.setExpressionObject(new Expression((String)attribute.getValue()));
        attributes.put("something", attribute);
        Definition definition = new Definition("definitionName", new Attribute("template"), attributes);
        Definition nudef = PatternUtil.replacePlaceholders(definition, "nudef", "value0", "value1", "value2", "value3");
        assertEquals("nudef", nudef.getName());

View Full Code Here

        Attribute nuattr;
        nuattr = new Attribute();

        nuattr.setRole(replace(attr.getRole(), vars));
        nuattr.setRenderer(attr.getRenderer());
        Expression expressionObject = attr.getExpressionObject();
        if (expressionObject != null) {
            Expression newExpressionObject = Expression
                    .createExpression(replace(expressionObject.getExpression(), vars), expressionObject.getLanguage());
            nuattr.setExpressionObject(newExpressionObject);
        }

        Object value = attr.getValue();
View Full Code Here

TOP

Related Classes of org.apache.tiles.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.