1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.eclipse.aether.collection;
20
21 import java.util.List;
22
23 import org.eclipse.aether.RepositorySystemSession;
24 import org.eclipse.aether.artifact.Artifact;
25 import org.eclipse.aether.graph.Dependency;
26
27 /**
28 * A context used during dependency collection to update the dependency manager, selector and traverser.
29 *
30 * @see DependencyManager#deriveChildManager(DependencyCollectionContext)
31 * @see DependencyTraverser#deriveChildTraverser(DependencyCollectionContext)
32 * @see DependencySelector#deriveChildSelector(DependencyCollectionContext)
33 * @see VersionFilter#deriveChildFilter(DependencyCollectionContext)
34 * @noimplement This interface is not intended to be implemented by clients.
35 * @noextend This interface is not intended to be extended by clients.
36 */
37 public interface DependencyCollectionContext {
38
39 /**
40 * Gets the repository system session during which the dependency collection happens.
41 *
42 * @return The repository system session, never {@code null}.
43 */
44 RepositorySystemSession getSession();
45
46 /**
47 * Gets the artifact whose children are to be processed next during dependency collection. For all nodes but the
48 * root, this is simply shorthand for {@code getDependency().getArtifact()}. In case of the root node however,
49 * {@link #getDependency()} might be {@code null} while the node still has an artifact which serves as its label and
50 * is not to be resolved.
51 *
52 * @return The artifact whose children are going to be processed or {@code null} in case of the root node without
53 * dependency and label.
54 */
55 Artifact getArtifact();
56
57 /**
58 * Gets the dependency whose children are to be processed next during dependency collection.
59 *
60 * @return The dependency whose children are going to be processed or {@code null} in case of the root node without
61 * dependency.
62 */
63 Dependency getDependency();
64
65 /**
66 * Gets the dependency management information that was contributed by the artifact descriptor of the current
67 * dependency.
68 *
69 * @return The dependency management information, never {@code null}.
70 */
71 List<Dependency> getManagedDependencies();
72 }