/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.tamaya.spi;


import java.util.List;

/**
 * Central SPI for programmatically dealing with the setup of the configuration system.
 * This includes adding and enlisting {@link org.apache.tamaya.spi.PropertySource}s,
 * managing {@link org.apache.tamaya.spi.PropertyConverter}s, ConfigFilters, etc.
 */
public interface ConfigurationContext {

    /**
     * This method can be used for programmatically adding {@link PropertySource}s.
     * It is not needed for normal 'usage' by end users, but only for Extension Developers!
     *
     * @param propertySourcesToAdd the PropertySources to add
     */
    void addPropertySources(PropertySource... propertySourcesToAdd);

    /**
     * This method returns the list of registered PropertySources ordered via their ordinal.
     * PropertySources with a lower ordinal come first. The PropertySource with the
     * highest ordinal comes last.
     * If two PropertySources have the same ordinal number they will get sorted
     * using their class name just to ensure the user at least gets the same ordering
     * after a JVM restart.
     *
     * @return sorted list of registered PropertySources
     */
    List<PropertySource> getPropertySources();

}

@@ -856,16 +856,38 @@
 il.List;
+%0Aimport java.util.Map;
 %0A%0A/**%0A *
@@ -2049,10 +2049,1548 @@
 ces();%0A%0A
+%0A    /**%0A     * This method can be used for programmatically adding %7B@link PropertyConverter%7Ds.%0A     * It is not needed for normal 'usage' by end users, but only for Extension Developers!%0A     *%0A     * @param typeToConvert the type which the converter is for%0A     * @param propertyConverter the PropertyConverters to add for this type%0A     */%0A    %3CT%3E void addPropertyConverter(Class%3CT%3E typeToConvert, PropertyConverter%3CT%3E propertyConverter);%0A%0A    /**%0A     * %3Cp%3E%0A     * This method returns the Map of registered PropertyConverters%0A     * per type.%0A     * The List for each type is ordered via their %7B@link javax.annotation.Priority%7D.%0A     * %3C/p%3E%0A     *%0A     * %3Cp%3E%0A     * PropertyConverters with a lower Priority come first. The PropertyConverter with the%0A     * highest Priority comes last.%0A     * If two PropertyConverter have the same ordinal number they will get sorted%0A     * using their class name just to ensure the user at least gets the same ordering%0A     * after a JVM restart.%0A     * %3C/p%3E%0A     *%0A     * %3Cp%3E%0A     * The scenario could be like:%0A     * %3Cpre%3E%0A     *  %7B%0A     *      Date.class -%3E %7BStandardDateConverter, TimezoneDateConverter, MyCustomDateConverter %7D%0A     *      Boolean.class -%3E %7BStandardBooleanConverter, FrenchBooleanConverter%7D%0A     *  %7D%0A     * %3C/pre%3E%0A     * %3C/p%3E%0A     *%0A     * TODO: we need to define in which order the converters will be used later!%0A     *%0A     * @return map with sorted list of registered PropertySources per type.%0A     */%0A    Map%3CClass%3C?%3E, List%3CPropertyConverter%3C?%3E%3E%3E getPropertyConverters();%0A%0A
 %7D%0A

add a way to register and lookup Converters