| 1 | |
package org.jbehave.core.steps; |
| 2 | |
|
| 3 | |
import java.util.ArrayList; |
| 4 | |
import java.util.List; |
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
public class CompositeStepsFactory implements InjectableStepsFactory { |
| 11 | |
|
| 12 | |
private final InjectableStepsFactory[] stepsFactories; |
| 13 | |
|
| 14 | 0 | public CompositeStepsFactory(InjectableStepsFactory... stepsFactories) { |
| 15 | 0 | this.stepsFactories = stepsFactories; |
| 16 | 0 | } |
| 17 | |
|
| 18 | |
public List<CandidateSteps> createCandidateSteps() { |
| 19 | 0 | List<CandidateSteps> steps = new ArrayList<CandidateSteps>(); |
| 20 | 0 | for (InjectableStepsFactory factory : stepsFactories) { |
| 21 | 0 | steps.addAll(factory.createCandidateSteps()); |
| 22 | |
} |
| 23 | 0 | return steps; |
| 24 | |
} |
| 25 | |
|
| 26 | |
} |