1 /*******************************************************************************
2 * Copyright (c) 2010, 2014 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
9 * Sonatype, Inc. - initial API and implementation
10 *******************************************************************************/
11 package org
.eclipse
.aether
.collection
;
13 import org
.eclipse
.aether
.graph
.Dependency
;
16 * Decides what dependencies to include in the dependency graph.
18 * <strong>Note:</strong> Implementations must be stateless.
20 * <em>Warning:</em> This hook is called from a hot spot and therefore implementations should pay attention to
21 * performance. Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method.
23 * @see org.eclipse.aether.RepositorySystemSession#getDependencySelector()
24 * @see org.eclipse.aether.RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession,
27 public interface DependencySelector
31 * Decides whether the specified dependency should be included in the dependency graph.
33 * @param dependency The dependency to check, must not be {@code null}.
34 * @return {@code false} if the dependency should be excluded from the children of the current node, {@code true}
37 boolean selectDependency( Dependency dependency
);
40 * Derives a dependency selector for the specified collection context. When calculating the child selector,
41 * implementors are strongly advised to simply return the current instance if nothing changed to help save memory.
43 * @param context The dependency collection context, must not be {@code null}.
44 * @return The dependency selector for the target node or {@code null} if dependencies should be unconditionally
45 * included in the sub graph.
47 DependencySelector
deriveChildSelector( DependencyCollectionContext context
);