Creates an XML node representing all the repos in this model.
(Node parent)
| 278 | |
| 279 | /** Creates an XML node representing all the repos in this model. */ |
| 280 | private Node sourceNode(Node parent) { |
| 281 | Node source = new Node(parent, "source"); |
| 282 | @SuppressWarnings("unchecked") |
| 283 | BiConsumer<Iterable<String>, Consumer<Map<String, String>>> addRepos = (urls, repoAttributes) -> { |
| 284 | for (String url : urls) { |
| 285 | Node repository = source.appendNode("repository"); |
| 286 | repository.attributes().put("location", url); |
| 287 | repoAttributes.accept(repository.attributes()); |
| 288 | } |
| 289 | }; |
| 290 | addRepos.accept(repos, Consumers.doNothing()); |
| 291 | addRepos.accept(metadataRepos, repoAttr -> repoAttr.put("kind", "metadata")); |
| 292 | addRepos.accept(artifactRepos, repoAttr -> repoAttr.put("kind", "artifact")); |
| 293 | return source; |
| 294 | } |
| 295 | |
| 296 | /** Creates an XML node for slicingOptions. */ |
| 297 | private Node slicingOptionsNode(Node parent) { |