View Javadoc

1   /*
2    * This file is part of AceLogger.
3    * 
4    * AceLogger is free software: you can redistribute it and/or modify it under the terms of the GNU
5    * Lesser General Public License as published by the Free Software Foundation, either version 3 of
6    * the License, or (at your option) any later version.
7    * 
8    * AceLogger is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
9    * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10   * Lesser General Public License for more details.
11   * 
12   * You should have received a copy of the GNU Lesser General Public License along with AceLogger.
13   * If not, see <http://www.gnu.org/licenses/lgpl-3.0.html>.
14   */
15  package net.sourceforge.acelogger.configuration;
16  
17  import java.io.InputStream;
18  import java.util.Collection;
19  
20  import net.sourceforge.acelogger.execution.LogController;
21  
22  /**
23   * A base implementation for configuration loaders. Common methods for all loaders should be
24   * abstracted by this class.
25   * 
26   * @author Zardi (https://sourceforge.net/users/daniel_zardi)
27   * @version 1.0.0
28   * @since 1.0.0
29   */
30  public abstract class BaseConfigurationLoader implements ConfigurationLoader {
31  
32  	/** {@inheritDoc} */
33  	public final void configureFromMultipleSources(InputStream... sources) {
34  		if (sources == null) {
35  			LogController.getInternalLogger().warn(
36  					"Received <null> as value for multiple sources configuration");
37  		} else {
38  			for (InputStream currentSource : sources) {
39  				configureFrom(currentSource);
40  			}
41  		}
42  	}
43  
44  	/** {@inheritDoc} */
45  	public final void configureFromMultipleSources(Collection<InputStream> sources) {
46  		if (sources == null) {
47  			LogController.getInternalLogger().warn(
48  					"Received <null> as value for multiple sources configuration");
49  		} else {
50  			for (InputStream currentSource : sources) {
51  				configureFrom(currentSource);
52  			}
53  		}
54  	}
55  
56  }