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 whether the dependencies of a dependency node should be traversed as well.
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#getDependencyTraverser()
24 * @see org.eclipse.aether.RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession,
27 public interface DependencyTraverser
31 * Decides whether the dependencies of the specified dependency should be traversed.
33 * @param dependency The dependency to check, must not be {@code null}.
34 * @return {@code true} if the dependency graph builder should recurse into the specified dependency and process its
35 * dependencies, {@code false} otherwise.
37 boolean traverseDependency( Dependency dependency
);
40 * Derives a dependency traverser that will be used to decide whether the transitive dependencies of the dependency
41 * given in the collection context shall be traversed. When calculating the child traverser, implementors are
42 * strongly advised to simply return the current instance if nothing changed to help save memory.
44 * @param context The dependency collection context, must not be {@code null}.
45 * @return The dependency traverser for the target node or {@code null} if dependencies should be unconditionally
46 * traversed in the sub graph.
48 DependencyTraverser
deriveChildTraverser( DependencyCollectionContext context
);