1 package org.codehaus.plexus.configuration.source;
2
3 import java.util.List;
4
5 import org.codehaus.plexus.component.repository.ComponentDescriptor;
6 import org.codehaus.plexus.configuration.PlexusConfiguration;
7
8
9
10
11
12
13
14
15
16 public class ChainedConfigurationSource implements ConfigurationSource {
17 private List configurationSources;
18
19 public ChainedConfigurationSource(List configurationSources) {
20 this.configurationSources = configurationSources;
21 }
22
23 public PlexusConfiguration getConfiguration(ComponentDescriptor componentDescriptor) {
24 for (Object configurationSource1 : configurationSources) {
25 ConfigurationSource configurationSource = (ConfigurationSource) configurationSource1;
26
27 PlexusConfiguration configuration = configurationSource.getConfiguration(componentDescriptor);
28
29 if (configuration != null) {
30 return configuration;
31 }
32 }
33
34 return null;
35 }
36
37 public List getConfigurationSources() {
38 return configurationSources;
39 }
40 }