Package org.apache.velocity.app

Examples of org.apache.velocity.app.VelocityEngine.addProperty()


    
        for (Iterator i = properties.keySet().iterator(); i.hasNext();)
        {
            String key = (String) i.next();
            String value = (String) properties.get(key);
            ve.addProperty(key, value);
            info("Add property: "+key+" = "+value);
        }
       
        ve.init();
       
View Full Code Here


    protected VelocityEngine newStringEngine(String repoName, boolean isStatic)
    {
        VelocityEngine engine = new VelocityEngine();
        engine.setProperty(Velocity.RESOURCE_LOADER, "string");
        engine.addProperty("string.resource.loader.class", StringResourceLoader.class.getName());
        if (repoName != null)
        {
            engine.addProperty("string.resource.loader.repository.name", repoName);
        }
        if (!isStatic)
View Full Code Here

        VelocityEngine engine = new VelocityEngine();
        engine.setProperty(Velocity.RESOURCE_LOADER, "string");
        engine.addProperty("string.resource.loader.class", StringResourceLoader.class.getName());
        if (repoName != null)
        {
            engine.addProperty("string.resource.loader.repository.name", repoName);
        }
        if (!isStatic)
        {
            engine.addProperty("string.resource.loader.repository.static", "false");
        }
View Full Code Here

        {
            engine.addProperty("string.resource.loader.repository.name", repoName);
        }
        if (!isStatic)
        {
            engine.addProperty("string.resource.loader.repository.static", "false");
        }
        engine.addProperty("string.resource.loader.modificationCheckInterval", "1");
        engine.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, SystemLogChute.class.getName());
        return engine;
    }
View Full Code Here

        }
        if (!isStatic)
        {
            engine.addProperty("string.resource.loader.repository.static", "false");
        }
        engine.addProperty("string.resource.loader.modificationCheckInterval", "1");
        engine.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, SystemLogChute.class.getName());
        return engine;
    }

    protected StringResourceRepository getRepo(String name, VelocityEngine engine)
View Full Code Here

            }

            if (useClasspath)
            {
                log("Using classpath");
                ve.addProperty(
                    VelocityEngine.RESOURCE_LOADER, "classpath");

                ve.setProperty(
                    "classpath." + VelocityEngine.RESOURCE_LOADER + ".class",
                        "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
View Full Code Here

        /**
         * Check that #set does not accept nulls
         */

        VelocityEngine ve = new VelocityEngine();
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();

        checkTemplate(ve,"set1");

        /**
 
View Full Code Here

        /**
         * Check that setting the property is the same as the default
         */
        ve = new VelocityEngine();
        ve.addProperty(RuntimeConstants.SET_NULL_ALLOWED, "false");
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();

        checkTemplate(ve,"set1");

View Full Code Here

        /**
         * Check that setting the property is the same as the default
         */
        ve = new VelocityEngine();
        ve.addProperty(RuntimeConstants.SET_NULL_ALLOWED, "false");
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();

        checkTemplate(ve,"set1");

        /**
 
View Full Code Here

        /**
         * Check that #set can accept nulls, and has the correct behaviour for complex LHS
         */
        ve = new VelocityEngine();
        ve.addProperty(RuntimeConstants.SET_NULL_ALLOWED, "true");
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();

        checkTemplate(ve,"set2");
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.