Package org.apache.commons.collections

Examples of org.apache.commons.collections.ExtendedProperties.addProperty()


    public void testExtendedPropertiesToConfiguration()
    {
        ExtendedProperties eprops = new ExtendedProperties();
        eprops.setProperty("string", "teststring");
        eprops.setProperty("int", "123");
        eprops.addProperty("list", "item 1");
        eprops.addProperty("list", "item 2");

        Configuration config = ConfigurationConverter.getConfiguration(eprops);

        assertEquals("This returns 'teststring'", "teststring", config.getString("string"));
View Full Code Here


    {
        ExtendedProperties eprops = new ExtendedProperties();
        eprops.setProperty("string", "teststring");
        eprops.setProperty("int", "123");
        eprops.addProperty("list", "item 1");
        eprops.addProperty("list", "item 2");

        Configuration config = ConfigurationConverter.getConfiguration(eprops);

        assertEquals("This returns 'teststring'", "teststring", config.getString("string"));
        List<Object> item1 = config.getList("list");
View Full Code Here

            velocity.setApplicationAttribute(SERVLET_CONTEXT_KEY, getServletContext());
            velocity.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.tools.view.servlet.ServletLogger");
            velocity.setProperty(VelocityEngine.RESOURCE_LOADER, "webapp");
            velocity.setProperty("webapp.resource.loader.class", "org.apache.velocity.tools.view.servlet.WebappLoader");
            ExtendedProperties configuration = loadConfiguration(getServletConfig());
            configuration.addProperty("velocimacro.library", macros.getAppRelativePath());
            velocity.setExtendedProperties(configuration);

            // initialize and return velocity engine
            velocity.init();
            log.debug("initVelocity(): create new VelocityEngine instance to support " + macros.getAppRelativePath() + " decoration template macros");
View Full Code Here

    }

    public void init() throws Exception {
        ExtendedProperties eprops = new ExtendedProperties();
        eprops.putAll(velocityProperties);
        eprops.addProperty(RuntimeConstants.RESOURCE_LOADER, "micro");

        eprops.setProperty("micro.resource.loader.description", "Micro internal resource loader.");
        eprops.setProperty("micro.resource.loader.class", "ca.simplegames.micro.viewers.velocity.MicroResourceLoader");
        eprops.setProperty("runtime.log.logsystem.class", "ca.simplegames.micro.viewers.velocity.VelocityViewRenderer");
        //eprops.setProperty("micro.resource.loader.repository", repository);
View Full Code Here

            velocity.setApplicationAttribute(SERVLET_CONTEXT_KEY, getServletContext());
            velocity.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.tools.view.servlet.ServletLogger");
            ExtendedProperties configuration = loadConfiguration(getServletConfig());
            if (macros != null)
            {
                configuration.addProperty("velocimacro.library", macros.getAppRelativePath());
            }
            configuration.setProperty("file.resource.loader.path", getServletContext().getRealPath("/"));
            velocity.setExtendedProperties(configuration);

            // initialize and return velocity engine
View Full Code Here

            velocity.setApplicationAttribute(SERVLET_CONTEXT_KEY, getServletContext());
            velocity.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.tools.view.servlet.ServletLogger");
            velocity.setProperty(VelocityEngine.RESOURCE_LOADER, "webapp");
            velocity.setProperty("webapp.resource.loader.class", "org.apache.velocity.tools.view.servlet.WebappLoader");
            ExtendedProperties configuration = loadConfiguration(getServletConfig());
            configuration.addProperty("velocimacro.library", macros.getAppRelativePath());
            velocity.setExtendedProperties(configuration);

            // initialize and return velocity engine
            velocity.init();
            log.debug("initVelocity(): create new VelocityEngine instance to support " + macros.getAppRelativePath() + " decoration template macros");
View Full Code Here

        // Try reading an overriding Velocity configuration
        try
        {
            ExtendedProperties p = loadConfiguration(config);
            p.addProperty("velocimacro.library", "/WEB-INF/jetspeed_macros.vm");
            p.setProperty("file.resource.loader.path", getServletContext().getRealPath("/"));
            velocity.setExtendedProperties(p);
        }
        catch(Exception e)
        {
View Full Code Here

            velocity.setApplicationAttribute(SERVLET_CONTEXT_KEY, getServletContext());
            velocity.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.tools.view.servlet.ServletLogger");
            ExtendedProperties configuration = loadConfiguration(getServletConfig());
            if (macros != null)
            {
                configuration.addProperty("velocimacro.library", macros.getAppRelativePath());
            }
            configuration.setProperty("file.resource.loader.path", getServletContext().getRealPath("/"));
            velocity.setExtendedProperties(configuration);

            // initialize and return velocity engine
View Full Code Here

    public void testExtendedPropertiesToConfiguration()
    {
        ExtendedProperties eprops = new ExtendedProperties();
        eprops.setProperty("string", "teststring");
        eprops.setProperty("int", "123");
        eprops.addProperty("list", "item 1");
        eprops.addProperty("list", "item 2");

        Configuration config = ConfigurationConverter.getConfiguration(eprops);

        assertEquals("This returns 'teststring'", "teststring", config.getString("string"));
View Full Code Here

    {
        ExtendedProperties eprops = new ExtendedProperties();
        eprops.setProperty("string", "teststring");
        eprops.setProperty("int", "123");
        eprops.addProperty("list", "item 1");
        eprops.addProperty("list", "item 2");

        Configuration config = ConfigurationConverter.getConfiguration(eprops);

        assertEquals("This returns 'teststring'", "teststring", config.getString("string"));
        List item1 = config.getList("list");
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.