001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.commons.configuration2.builder.combined; 018 019import org.apache.commons.configuration2.Configuration; 020import org.apache.commons.configuration2.builder.ConfigurationBuilder; 021import org.apache.commons.configuration2.ex.ConfigurationException; 022 023/** 024 * <p> 025 * An interface for creating builders for configuration sources of a 026 * {@link CombinedConfigurationBuilder}. 027 * </p> 028 * <p> 029 * When processing its definition file {@code CombinedConfigurationBuilder} 030 * scans for tags declaring configuration sources and maps them to 031 * implementations of this interface. The instances are then used to obtain 032 * builder objects to create the corresponding configuration sources. Parameters 033 * of the builders are provided as {@link ConfigurationDeclaration} objects. 034 * </p> 035 * 036 * @version $Id: ConfigurationBuilderProvider.java 1624601 2014-09-12 18:04:36Z oheger $ 037 * @since 2.0 038 */ 039public interface ConfigurationBuilderProvider 040{ 041 /** 042 * Returns the builder for the configuration source managed by this 043 * provider. This method is called during processing of the combined 044 * configuration definition file. 045 * 046 * @param decl the bean declaration with initialization parameters for the 047 * configuration builder 048 * @return the {@code ConfigurationBuilder} object created by this provider 049 * @throws ConfigurationException if an error occurs 050 */ 051 ConfigurationBuilder<? extends Configuration> getConfigurationBuilder( 052 ConfigurationDeclaration decl) 053 throws ConfigurationException; 054}