Package org.apache.commons.configuration2

Examples of org.apache.commons.configuration2.BaseConfiguration.addProperty()


                    }
                };
        BaseHierarchicalConfiguration defConf = new BaseHierarchicalConfiguration();
        defConf.addProperty("header.result.nodeCombiner[@config-class]",
                MergeCombiner.class.getName());
        defConf.addProperty("header.result.expressionEngine[@config-class]",
                XPathExpressionEngine.class.getName());
        addReloadSource(defConf, "configA.xml");
        addReloadSource(defConf, "configB.xml");
        Synchronizer sync = new ReadWriteSynchronizer();
        builder.configure(parameters
View Full Code Here


        BaseHierarchicalConfiguration defConfig =
                new BaseHierarchicalConfiguration();
        String prefix = "override." + tag;
        for (Map.Entry<String, Object> e : attrs.entrySet())
        {
            defConfig.addProperty(prefix + "[@" + e.getKey() + "]",
                    e.getValue());
        }
        return defConfig;
    }
View Full Code Here

        public ConfigurationBuilder<? extends Configuration> getConfigurationBuilder(
                ConfigurationDeclaration decl) throws ConfigurationException
        {
            BaseHierarchicalConfiguration config =
                    new BaseHierarchicalConfiguration();
            config.addProperty(getPropertyKey(), Boolean.TRUE);
            return new ConstantConfigurationBuilder(config);
        }
    }

    /**
 
View Full Code Here

    public void testCustomBuilderProvider() throws ConfigurationException
    {
        String tagName = "myTestTag";
        final BaseHierarchicalConfiguration dataConf =
                new BaseHierarchicalConfiguration();
        dataConf.addProperty(tagName, Boolean.TRUE);
        Map<String, Object> attrs = new HashMap<String, Object>();
        attrs.put("config-name", BUILDER_NAME);
        attrs.put("config-at", "tests");
        builder.configure(new CombinedBuilderParametersImpl()
                .setDefinitionBuilder(
View Full Code Here

    @Test
    public void testConfigureEntityResolverWithProperties()
            throws ConfigurationException
    {
        HierarchicalConfiguration<ImmutableNode> config = new BaseHierarchicalConfiguration();
        config.addProperty("header.entity-resolver[@config-class]",
                EntityResolverWithPropertiesTestImpl.class.getName());
        XMLBuilderParametersImpl xmlParams = new XMLBuilderParametersImpl();
        FileSystem fs = EasyMock.createMock(FileSystem.class);
        String baseDir = ConfigurationAssert.OUT_DIR_NAME;
        xmlParams.setBasePath(baseDir);
View Full Code Here

    public void testBasePathForChildConfigurations()
            throws ConfigurationException
    {
        BaseHierarchicalConfiguration defConfig =
                new BaseHierarchicalConfiguration();
        defConfig.addProperty("properties[@fileName]", "test.properties");
        File deepDir = new File(ConfigurationAssert.TEST_DIR, "config/deep");
        builder.configure(new CombinedBuilderParametersImpl().setBasePath(
                deepDir.getAbsolutePath()).setDefinitionBuilder(
                new ConstantConfigurationBuilder(defConfig)));
        CombinedConfiguration config = builder.getConfiguration();
View Full Code Here

    public void testConfigurationBuilderProvider()
            throws ConfigurationException
    {
        BaseHierarchicalConfiguration defConfig =
                new BaseHierarchicalConfiguration();
        defConfig.addProperty("override.configuration[@fileName]",
                TEST_FILE.getAbsolutePath());
        builder.configure(new CombinedBuilderParametersImpl()
                .setDefinitionBuilder(new ConstantConfigurationBuilder(
                        defConfig)));
        CombinedConfiguration cc = builder.getConfiguration();
View Full Code Here

        {
            configuration.setProperty(properties[i], values[i]);
        }

        for (int element : intArray) {
            configuration.addProperty("intIndexed", new Integer(element));
        }

        for (String element : stringArray) {
            configuration.addProperty("stringIndexed", element);
        }
View Full Code Here

        for (int element : intArray) {
            configuration.addProperty("intIndexed", new Integer(element));
        }

        for (String element : stringArray) {
            configuration.addProperty("stringIndexed", element);
        }

        List<String> list = Arrays.asList(stringArray);
        configuration.addProperty("listIndexed", list);
View Full Code Here

        for (String element : stringArray) {
            configuration.addProperty("stringIndexed", element);
        }

        List<String> list = Arrays.asList(stringArray);
        configuration.addProperty("listIndexed", list);

        bean = new ConfigurationDynaBean(configuration);

        bean.set("listIndexed", list);
        bean.set("intArray", intArray);
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.