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.RepositoryException;
12  import org.sonatype.aether.graph.DependencyNode;
13  
14  /**
15   * Transforms a given dependency graph. <em>Note:</em> Dependency graphs may contain cycles, as such a graph transformer
16   * needs to gracefully handle cyclic graphs, e.g. guard against infinite recursion.
17   * 
18   * @author Benjamin Bentmann
19   * @see org.sonatype.aether.RepositorySystemSession#getDependencyGraphTransformer()
20   */
21  public interface DependencyGraphTransformer
22  {
23  
24      /**
25       * Transforms the dependency graph denoted by the specified root node. The transformer may directly change the
26       * provided input graph or create a new graph.
27       * 
28       * @param node The root node of the (possibly cyclic!) graph to transform, must not be {@code null}.
29       * @param context The graph transformation context, must not be {@code null}.
30       * @return The result graph of the transformation, never {@code null}.
31       * @throws RepositoryException If the transformation failed.
32       */
33      DependencyNode transformGraph( DependencyNode node, DependencyGraphTransformationContext context )
34          throws RepositoryException;
35  
36  }