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