Examples of ExtendedProperties


Examples of org.apache.commons.collections.ExtendedProperties

            Data data = new Data();
            data.setKey(key);
            data.setValue(dataset.getString(key));

            // get/set the type/converter properties
            ExtendedProperties props = dataset.subset(key);
            setProperties(props, data);
        }
    }
View Full Code Here

Examples of org.apache.commons.collections.ExtendedProperties

        }

        // this will throw an exception if require is true and there
        // are no properties at the path.  if require is false, this
        // will return null when there's no properties at the path
        ExtendedProperties props = getProperties(path, require);
        if (props == null)
        {
            return false;
        }
View Full Code Here

Examples of org.apache.commons.collections.ExtendedProperties

        if (inputStream == null)
        {
            return null;
        }

        ExtendedProperties properties = new ExtendedProperties();
        try
        {
            properties.load(inputStream);
        }
        catch (IOException ioe)
        {
            String msg = "Failed to load properties at: "+path;
            getLog().error(msg, ioe);
View Full Code Here

Examples of org.apache.commons.collections.ExtendedProperties

*/
public class TestConfigurationConverter extends TestCase
{
    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"));
        List item1 = config.getList("list");
View Full Code Here

Examples of org.apache.commons.collections.ExtendedProperties

        config.setProperty("string", "teststring");
        config.setProperty("int", "123");
        config.addProperty("list", "item 1");
        config.addProperty("list", "item 2");

        ExtendedProperties eprops = ConfigurationConverter.getExtendedProperties(config);

        assertEquals("This returns 'teststring'", "teststring", eprops.getString("string"));
        List list = eprops.getVector("list");
        assertEquals("This returns 'item 1'", "item 1", (String) list.get(0));
        assertEquals("This returns 123", 123, eprops.getInt("int"));
    }
View Full Code Here

Examples of org.apache.commons.collections.ExtendedProperties

*/
public class TestConfigurationConverter extends TestCase
{
    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"));
        List item1 = config.getList("list");
View Full Code Here

Examples of org.apache.commons.collections.ExtendedProperties

        config.setProperty("string", "teststring");
        config.setProperty("int", "123");
        config.addProperty("list", "item 1");
        config.addProperty("list", "item 2");

        ExtendedProperties eprops = ConfigurationConverter.getExtendedProperties(config);

        assertEquals("This returns 'teststring'", "teststring", eprops.getString("string"));
        List list = eprops.getVector("list");
        assertEquals("This returns 'item 1'", "item 1", (String) list.get(0));
        assertEquals("This returns 123", 123, eprops.getInt("int"));
    }
View Full Code Here

Examples of org.apache.commons.collections.ExtendedProperties

        try {
            if (f.exists()) {

                ConnectionProperties cp = new ConnectionProperties(
                        new ExtendedProperties(f.getAbsolutePath()));

                if (((adapter != null && !adapter.startsWith("$"))
                        || (usr != null && !usr.startsWith("$"))
                        || (pass != null && !pass.startsWith("$"))
                        || (url != null && !url.startsWith("$")) || (driver != null && !driver
                        .startsWith("$")))
                        && (System.getProperty("cayenneTestConnection") != null && !System
                                .getProperty("cayenneTestConnection")
                                .equals("null"))) {

                    DataSourceInfo dsiOld = null;
                    if (connectionInfos.get(System.getProperty("cayenneTestConnection")) != null) {
                        dsiOld = connectionInfos.get(System
                                .getProperty("cayenneTestConnection"));
                        connectionInfos.remove(System
                                .getProperty("cayenneTestConnection"));
                    }

                    if (adapter != null && !adapter.startsWith("$")) {
                        dsi.setAdapterClassName(adapter);
                    }
                    else if (dsiOld != null) {
                        dsi.setAdapterClassName(dsiOld.getAdapterClassName());
                    }
                    if (usr != null && !usr.startsWith("$")) {
                        dsi.setUserName(usr);
                    }
                    else if (dsiOld != null) {
                        dsi.setUserName(dsiOld.getUserName());
                    }
                    if (pass != null && !pass.startsWith("$")) {
                        dsi.setPassword(pass);
                    }
                    else if (dsiOld != null) {
                        dsi.setPassword(dsiOld.getPassword());
                    }
                    if (url != null && !url.startsWith("$")) {
                        dsi.setDataSourceUrl(url);
                    }
                    else if (dsiOld != null) {
                        dsi.setDataSourceUrl(dsiOld.getDataSourceUrl());
                    }
                    if (driver != null && !driver.startsWith("$")) {
                        dsi.setJdbcDriver(driver);
                    }
                    else if (dsiOld != null) {
                        dsi.setJdbcDriver(dsiOld.getJdbcDriver());
                    }
                    connectionInfos.put(System.getProperty("cayenneTestConnection"), dsi);
                }
                else {
                    return cp;
                }
            }
            else {
                if (((adapter != null && !adapter.startsWith("$"))
                        || (usr != null && !usr.startsWith("$"))
                        || (pass != null && !pass.startsWith("$"))
                        || (url != null && !url.startsWith("$")) || (driver != null && !driver
                        .startsWith("$")))
                        && (System.getProperty("cayenneTestConnection") != null && !System
                                .getProperty("cayenneTestConnection")
                                .equals("null"))) {

                    if (adapter != null && !adapter.startsWith("$")) {
                        dsi.setAdapterClassName(adapter);
                    }
                    if (usr != null && !usr.startsWith("$")) {
                        dsi.setUserName(usr);
                    }
                    if (pass != null && !pass.startsWith("$")) {
                        dsi.setPassword(pass);
                    }
                    if (url != null && !url.startsWith("$")) {
                        dsi.setDataSourceUrl(url);
                    }
                    if (driver != null && !driver.startsWith("$")) {
                        dsi.setJdbcDriver(driver);
                    }
                    connectionInfos.put(System.getProperty("cayenneTestConnection"), dsi);
                }

                // lets touch this file so that users would get a clue of what it is
                createSamplePropertiesFile(f);

            }
        }
        catch (IOException e) {
            // ignoring
        }

        return new ConnectionProperties(new ExtendedProperties());
    }
View Full Code Here

Examples of org.apache.commons.collections.ExtendedProperties

    private EventSubject createSubject() {
        return EventSubject.getSubject(this.getClass(), name);
    }

    protected void initWithProperties(Map properties) {
        ExtendedProperties propertiesWrapper = new ExtendedProperties();

        if (properties != null) {
            propertiesWrapper.putAll(properties);
        }

        long snapshotsExpiration = propertiesWrapper.getLong(
                SNAPSHOT_EXPIRATION_PROPERTY,
                SNAPSHOT_EXPIRATION_DEFAULT);

        int snapshotsCacheSize = propertiesWrapper.getInt(
                SNAPSHOT_CACHE_SIZE_PROPERTY,
                SNAPSHOT_CACHE_SIZE_DEFAULT);

        boolean notifyRemote = propertiesWrapper.getBoolean(
                REMOTE_NOTIFICATION_PROPERTY,
                REMOTE_NOTIFICATION_DEFAULT);

        String eventBridgeFactory = propertiesWrapper.getString(
                EVENT_BRIDGE_FACTORY_PROPERTY,
                EVENT_BRIDGE_FACTORY_DEFAULT);

        if (logger.isDebugEnabled()) {
            logger.debug("DataRowStore property "
View Full Code Here

Examples of org.apache.commons.collections.ExtendedProperties

     */
    public void setProperty(String key, Object value)
    {
        if (overridingProperties == null)
        {
            overridingProperties = new ExtendedProperties();
        }

        overridingProperties.setProperty(key, value);
    }
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.