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;
018
019import org.apache.commons.configuration2.event.EventListenerList;
020
021/**
022 * <p>
023 * Definition of an interface that is evaluated by a {@link ConfigurationBuilder} to initialize event listeners.
024 * </p>
025 * <p>
026 * This interface allows a convenient initialization of a configuration builder with event listeners to be registered at
027 * the managed configuration object. The {@code configure()} method of {@link BasicConfigurationBuilder} checks whether
028 * a parameters object passed to it implements this interface. If this is the case, all event listeners defined by the
029 * object are added to the internal list managed by the builder. They are then automatically registered at the managed
030 * configuration when it is created. When using a corresponding implementation the configuration of event listeners can
031 * be done in the same fluent API style as the other initialization of the configuration builder.
032 * </p>
033 *
034 * @since 2.0
035 */
036public interface EventListenerProvider {
037    /**
038     * Gets an {@code EventListenerList} object with information about event listener registrations. All listeners
039     * contained in this object are added to the processing {@code ConfigurationBuilder}.
040     *
041     * @return the {@code EventListenerList} with event listener registrations (must not be <b>null</b>)
042     */
043    EventListenerList getListeners();
044}