View Javadoc

1   package org.sonatype.aether.collection;
2   
3   /*******************************************************************************
4    * Copyright (c) 2010-2011 Sonatype, Inc.
5    * All rights reserved. This program and the accompanying materials
6    * are made available under the terms of the Eclipse Public License v1.0
7    * which accompanies this distribution, and is available at
8    *   http://www.eclipse.org/legal/epl-v10.html
9    *******************************************************************************/
10  
11  import org.sonatype.aether.graph.Dependency;
12  
13  /**
14   * Applies dependency management to the dependencies of a dependency node. <em>Note:</em> For the sake of good
15   * performance during dependency collection, implementations should provide a semantic {@link Object#equals(Object)
16   * equals()} method.
17   * 
18   * @author Benjamin Bentmann
19   * @see org.sonatype.aether.RepositorySystemSession#getDependencyManager()
20   * @see org.sonatype.aether.RepositorySystem#collectDependencies(org.sonatype.aether.RepositorySystemSession,
21   *      CollectRequest)
22   */
23  public interface DependencyManager
24  {
25  
26      /**
27       * Applies dependency management to the specified dependency.
28       * 
29       * @param dependency The dependency to manage, must not be {@code null}.
30       * @return The management update to apply to the dependency or {@code null} if the dependency is not managed at all.
31       */
32      DependencyManagement manageDependency( Dependency dependency );
33  
34      /**
35       * Derives a dependency manager for the specified collection context. When calculating the child manager,
36       * implementors are strongly advised to simply return the current instance if nothing changed to help save memory.
37       * 
38       * @param context The dependency collection context, must not be {@code null}.
39       * @return The dependency manager for the dependencies of the target node, must not be {@code null}.
40       */
41      DependencyManager deriveChildManager( DependencyCollectionContext context );
42  
43  }