public CreateResult[] create(ImportResult[] results, int[][] indexes, boolean onStartup) {
List elementsToCreate = new ArrayList();
List attributesForCreation = new ArrayList();
if (indexes == null) {
for (int i = 0; i < results.length; i++) {
ImportResult result = results[i];
elementsToCreate.addAll(result.getRootNode().getChildren());
while (attributesForCreation.size() < elementsToCreate.size())
attributesForCreation.add(result.getAttributes());
}
} else {
for (int i = 0; i < indexes.length; i++) {
int[] index = indexes[i];
if (index != null)
if (index.length == 1) {
ImportResult result = results[index[0]];
elementsToCreate.addAll(result.getRootNode().getChildren());
while (attributesForCreation.size() < elementsToCreate.size())
attributesForCreation.add(result.getAttributes());
} else if (index.length > 1) {
ImportResult result = results[index[0]];
for (int j = 1; j < index.length; j++) {
int idx = index[j];
elementsToCreate.add(result.getRootNode().getChildren().get(idx));
while (attributesForCreation.size() < elementsToCreate.size())
attributesForCreation.add(result.getAttributes());
}
}
}
}
List createResults = new ArrayList();