1 package org.eclipse.aether.internal.impl;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.ArrayList;
23 import java.util.List;
24
25 import org.eclipse.aether.RequestTrace;
26 import org.eclipse.aether.graph.DependencyNode;
27 import org.eclipse.aether.graph.DependencyVisitor;
28 import org.eclipse.aether.resolution.ArtifactRequest;
29
30
31
32 class ArtifactRequestBuilder
33 implements DependencyVisitor
34 {
35
36 private final RequestTrace trace;
37
38 private List<ArtifactRequest> requests;
39
40 ArtifactRequestBuilder( RequestTrace trace )
41 {
42 this.trace = trace;
43 this.requests = new ArrayList<>();
44 }
45
46 public List<ArtifactRequest> getRequests()
47 {
48 return requests;
49 }
50
51 public boolean visitEnter( DependencyNode node )
52 {
53 if ( node.getDependency() != null )
54 {
55 ArtifactRequest request = new ArtifactRequest( node );
56 request.setTrace( trace );
57 requests.add( request );
58 }
59
60 return true;
61 }
62
63 public boolean visitLeave( DependencyNode node )
64 {
65 return true;
66 }
67
68 }