View Javadoc
1   /*******************************************************************************
2    * Copyright (c) 2010, 2013 Sonatype, Inc.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the Eclipse Public License v1.0
5    * which accompanies this distribution, and is available at
6    * http://www.eclipse.org/legal/epl-v10.html
7    *
8    * Contributors:
9    *    Sonatype, Inc. - initial API and implementation
10   *******************************************************************************/
11  package org.eclipse.aether.collection;
12  
13  import java.util.List;
14  
15  import org.eclipse.aether.RepositorySystemSession;
16  import org.eclipse.aether.artifact.Artifact;
17  import org.eclipse.aether.graph.Dependency;
18  
19  /**
20   * A context used during dependency collection to update the dependency manager, selector and traverser.
21   * 
22   * @see DependencyManager#deriveChildManager(DependencyCollectionContext)
23   * @see DependencyTraverser#deriveChildTraverser(DependencyCollectionContext)
24   * @see DependencySelector#deriveChildSelector(DependencyCollectionContext)
25   * @see VersionFilter#deriveChildFilter(DependencyCollectionContext)
26   * @noimplement This interface is not intended to be implemented by clients.
27   * @noextend This interface is not intended to be extended by clients.
28   */
29  public interface DependencyCollectionContext
30  {
31  
32      /**
33       * Gets the repository system session during which the dependency collection happens.
34       * 
35       * @return The repository system session, never {@code null}.
36       */
37      RepositorySystemSession getSession();
38  
39      /**
40       * Gets the artifact whose children are to be processed next during dependency collection. For all nodes but the
41       * root, this is simply shorthand for {@code getDependency().getArtifact()}. In case of the root node however,
42       * {@link #getDependency()} might be {@code null} while the node still has an artifact which serves as its label and
43       * is not to be resolved.
44       * 
45       * @return The artifact whose children are going to be processed or {@code null} in case of the root node without
46       *         dependency and label.
47       */
48      Artifact getArtifact();
49  
50      /**
51       * Gets the dependency whose children are to be processed next during dependency collection.
52       * 
53       * @return The dependency whose children are going to be processed or {@code null} in case of the root node without
54       *         dependency.
55       */
56      Dependency getDependency();
57  
58      /**
59       * Gets the dependency management information that was contributed by the artifact descriptor of the current
60       * dependency.
61       * 
62       * @return The dependency management information, never {@code null}.
63       */
64      List<Dependency> getManagedDependencies();
65  
66  }