X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.repo%2Fsrc%2Forg%2Feclipse%2Faether%2Fcollection%2FDependencyGraphTransformer.java;fp=org.argeo.slc.repo%2Fsrc%2Forg%2Feclipse%2Faether%2Fcollection%2FDependencyGraphTransformer.java;h=b3deebef78c20e7be76bb9c1194ccb30aefade1b;hb=825d60c5348dbe3f5be25b0bccf7bdebfe694219;hp=0000000000000000000000000000000000000000;hpb=5e991fff5cba01858dcc5747a27e637325bc5c8e;p=gpl%2Fargeo-jcr.git diff --git a/org.argeo.slc.repo/src/org/eclipse/aether/collection/DependencyGraphTransformer.java b/org.argeo.slc.repo/src/org/eclipse/aether/collection/DependencyGraphTransformer.java new file mode 100644 index 0000000..b3deebe --- /dev/null +++ b/org.argeo.slc.repo/src/org/eclipse/aether/collection/DependencyGraphTransformer.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2010, 2014 Sonatype, Inc. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sonatype, Inc. - initial API and implementation + *******************************************************************************/ +package org.eclipse.aether.collection; + +import org.eclipse.aether.RepositoryException; +import org.eclipse.aether.graph.DependencyNode; + +/** + * Transforms a given dependency graph. + *

+ * Note: Implementations must be stateless. + *

+ * Warning: Dependency graphs may generally contain cycles. As such a graph transformer that cannot assume for + * sure that cycles have already been eliminated must gracefully handle cyclic graphs, e.g. guard against infinite + * recursion. + * + * @see org.eclipse.aether.RepositorySystemSession#getDependencyGraphTransformer() + */ +public interface DependencyGraphTransformer +{ + + /** + * Transforms the dependency graph denoted by the specified root node. The transformer may directly change the + * provided input graph or create a new graph, the former is recommended for performance reasons. + * + * @param node The root node of the (possibly cyclic!) graph to transform, must not be {@code null}. + * @param context The graph transformation context, must not be {@code null}. + * @return The result graph of the transformation, never {@code null}. + * @throws RepositoryException If the transformation failed. + */ + DependencyNode transformGraph( DependencyNode node, DependencyGraphTransformationContext context ) + throws RepositoryException; + +}