|
25 | 25 |
|
26 | 26 | import javax.xml.bind.JAXBElement;
|
27 | 27 | import javax.xml.namespace.QName;
|
28 |
| -import java.util.HashSet; |
29 |
| -import java.util.List; |
30 |
| -import java.util.Map; |
31 |
| -import java.util.Set; |
| 28 | +import java.util.*; |
32 | 29 | import java.util.stream.Collectors;
|
33 | 30 |
|
34 | 31 | /**
|
@@ -61,14 +58,21 @@ public AbstractTopLevelElement(String flowName,
|
61 | 58 | }
|
62 | 59 |
|
63 | 60 | public List<DslSnippet> buildDslSnippets() {
|
64 |
| - return elements.stream() |
65 |
| - .map(o -> translate(o.getValue(), o.getName(), muleConfigurations, flowName)) |
66 |
| - .collect(Collectors.toList()); |
| 61 | + |
| 62 | + List<DslSnippet> dslSnippets = new ArrayList<>(); |
| 63 | + |
| 64 | + for (int i = 0; i < elements.size(); i++) { |
| 65 | + JAXBElement<?> o = elements.get(i); |
| 66 | + dslSnippets.add( |
| 67 | + translate(i, o.getValue(), o.getName(), muleConfigurations, flowName) |
| 68 | + ); |
| 69 | + } |
| 70 | + return dslSnippets; |
67 | 71 | }
|
68 | 72 |
|
69 |
| - private DslSnippet translate(Object o, QName name, MuleConfigurations muleConfigurations, String flowName) { |
| 73 | + private DslSnippet translate(int id, Object o, QName name, MuleConfigurations muleConfigurations, String flowName) { |
70 | 74 | MuleComponentToSpringIntegrationDslTranslator translator = translatorsMap.getOrDefault(o.getClass(), new UnknownStatementTranslator());
|
71 |
| - return translator.translate(o, name, muleConfigurations, flowName, this.translatorsMap); |
| 75 | + return translator.translate(id, o, name, muleConfigurations, flowName, this.translatorsMap); |
72 | 76 | }
|
73 | 77 |
|
74 | 78 |
|
|
0 commit comments