Java Code Examples for org.apache.commons.configuration2.ConfigurationUtils#cloneConfiguration()

The following examples show how to use org.apache.commons.configuration2.ConfigurationUtils#cloneConfiguration() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: spoofax   File: AConfigBuilder.java    License: Apache License 2.0 5 votes vote down vote up
protected HierarchicalConfiguration<ImmutableNode> cloneConfiguration(IConfig config) {
    // Clone configuration.
    final IConfig iconfig = (IConfig) config;
    final HierarchicalConfiguration<ImmutableNode> apacheConfig = iconfig.getConfig();
    final Configuration clonedConfig = ConfigurationUtils.cloneConfiguration(apacheConfig);
    @SuppressWarnings("unchecked") final HierarchicalConfiguration<ImmutableNode> clonedHierachicalConfig =
            (HierarchicalConfiguration<ImmutableNode>) clonedConfig;
    return clonedHierachicalConfig;
}
 
Example 2
Source Project: batfish   File: BaseSettings.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Initialize settings from an existing configuration
 *
 * @param config {@link Configuration} containing the desired settings
 */
public BaseSettings(Configuration config) {
  _options = new Options();
  _config = ConfigurationUtils.cloneConfiguration(config);
}