Examples of ConfigurationInterpolator


Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

     *
     * @return the {@code ConfigurationInterpolator}
     */
    protected ConfigurationInterpolator getInterpolator()
    {
        ConfigurationInterpolator result;
        boolean done;

        // This might create multiple instances under high load,
        // however, always the same instance is returned.
        do
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

     * @return the name of the configuration file to be loaded
     */
    protected String constructFileName(
            MultiFileBuilderParametersImpl multiParams)
    {
        ConfigurationInterpolator ci = getInterpolator();
        return String.valueOf(ci.interpolate(multiParams.getFilePattern()));
    }
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

     * @param value the value that is to be interpolated
     * @return the interpolated value
     */
    protected Object interpolate(Object value)
    {
        ConfigurationInterpolator interpolator =
                getConfiguration().getInterpolator();
        return (interpolator != null) ? interpolator.interpolate(value) : value;
    }
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

     *
     * @return the {@code ConfigurationInterpolator}
     */
    private ConfigurationInterpolator initLocalInterpolator()
    {
        ConfigurationInterpolator ci = new ConfigurationInterpolator()
        {
            @Override
            protected Lookup fetchLookupForPrefix(String prefix)
            {
                return ConfigurationInterpolator
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

                        .setListDelimiterHandler(
                                new DefaultListDelimiterHandler(';'));
        MultiFileBuilderParametersImpl params =
                new MultiFileBuilderParametersImpl().setFilePattern(PATTERN)
                        .setManagedBuilderParameters(xmlParams);
        ConfigurationInterpolator ci = createInterpolator();
        params.setInterpolator(ci).setListDelimiterHandler(
                new DefaultListDelimiterHandler('#'));
        builder.configure(params);
        switchToConfig(1);
        XMLConfiguration config = builder.getConfiguration();
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

                new MultiFileBuilderParametersImpl().setFilePattern(PATTERN);
        MultiFileConfigurationBuilder<XMLConfiguration> builder =
                new MultiFileConfigurationBuilder<XMLConfiguration>(
                        XMLConfiguration.class);
        builder.configure(params);
        ConfigurationInterpolator interpolator = builder.getInterpolator();
        assertNotNull("No interpolator", interpolator);
        builder.resetParameters();
        assertNotSame("No new interpolator", interpolator,
                builder.getInterpolator());
    }
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

    {
        DynamicCombinedConfiguration config =
                new DynamicCombinedConfiguration();
        config.setKeyPattern(PATTERN_VAR);
        BasicBuilderParameters params = createTestBuilderParameters(null);
        ConfigurationInterpolator ci = new ConfigurationInterpolator();
        ci.addDefaultLookup(new ConfigurationLookup(config));
        params.setInterpolator(ci);
        MultiFileConfigurationBuilder<XMLConfiguration> builder =
                new MultiFileConfigurationBuilder<XMLConfiguration>(
                        XMLConfiguration.class, null, true);
        builder.configure(params);
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

     *
     * @return the new {@code ConfigurationInterpolator}
     */
    protected static ConfigurationInterpolator createInterpolator()
    {
        ConfigurationInterpolator ci = new ConfigurationInterpolator();
        ci.registerLookup(DefaultLookups.SYSTEM_PROPERTIES.getPrefix(),
                DefaultLookups.SYSTEM_PROPERTIES.getLookup());
        return ci;
    }
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

     * already a {@code ConfigurationInterpolator} is available.
     */
    @Test
    public void testSetParentInterpolatorExistingInterpolator()
    {
        ConfigurationInterpolator parent =
                EasyMock.createMock(ConfigurationInterpolator.class);
        EasyMock.replay(parent);
        AbstractConfiguration config =
                new TestConfigurationImpl(new PropertiesConfiguration());
        ConfigurationInterpolator ci = config.getInterpolator();
        config.setParentInterpolator(parent);
        assertSame("Parent was not set", parent, config.getInterpolator()
                .getParentInterpolator());
        assertSame("Interpolator was changed", ci, config.getInterpolator());
    }
View Full Code Here

Examples of org.apache.commons.configuration2.interpol.ConfigurationInterpolator

     * currently no {@code ConfigurationInterpolator} is available.
     */
    @Test
    public void testSetParentInterpolatorNoInterpolator()
    {
        ConfigurationInterpolator parent =
                EasyMock.createMock(ConfigurationInterpolator.class);
        EasyMock.replay(parent);
        AbstractConfiguration config =
                new TestConfigurationImpl(new PropertiesConfiguration());
        config.setInterpolator(null);
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.