    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 *     https://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;
    018
    019import java.util.Map;
    020
    021/**
    022 * <p>
    023 * An interface to be implemented by objects which can be used to parameterize a {@link ConfigurationBuilder}.
    024 * </p>
    025 * <p>
    026 * This interface is part of a Java DSL for creating and initializing builders for specific {@code Configuration}
    027 * classes. Concrete implementations typically collect a set of related properties for the builder. There will be
    028 * specific set methods for providing values for these properties. Then, this interface requires a generic
    029 * {@code getParameters()} method which has to return all property values as a map. When constructing the builder the
    030 * map is evaluated to define properties of the {@code Configuration} objects to be constructed.
    031 * </p>
    032 *
    033 * @since 2.0
    034 */
    035public interface BuilderParameters {
    036
    037    /**
    038     * Constant for a prefix for reserved initialization parameter keys. If a parameter was set whose key starts with this
    039     * prefix, it is filtered out before the initialization of a newly created result object. This mechanism allows
    040     * implementing classes to store specific configuration data in the parameters map which does not represent a property
    041     * value for the result object.
    042     */
    043    String RESERVED_PARAMETER_PREFIX = "config-";
    044
    045    /**
    046     * Gets a map with all parameters defined by this objects. The keys of the map correspond to concrete properties
    047     * supported by the {@code Configuration} implementation class the builder produces. The values are the corresponding
    048     * property values. The return value must not be <strong>null</strong>.
    049     *
    050     * @return a map with builder parameters
    051     */
    052    Map<String, Object> getParameters();
    053}