1 /******************************************************************************* 2 * Copyright (c) 2010, 2011 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 7 * 8 * Contributors: 9 * Sonatype, Inc. - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.aether.graph; 12 13 /** 14 * A visitor for nodes of the dependency graph. 15 * 16 * @see DependencyNode#accept(DependencyVisitor) 17 */ 18 public interface DependencyVisitor 19 { 20 21 /** 22 * Notifies the visitor of a node visit before its children have been processed. 23 * 24 * @param node The dependency node being visited, must not be {@code null}. 25 * @return {@code true} to visit child nodes of the specified node as well, {@code false} to skip children. 26 */ 27 boolean visitEnter( DependencyNode node ); 28 29 /** 30 * Notifies the visitor of a node visit after its children have been processed. Note that this method is always 31 * invoked regardless whether any children have actually been visited. 32 * 33 * @param node The dependency node being visited, must not be {@code null}. 34 * @return {@code true} to visit siblings nodes of the specified node as well, {@code false} to skip siblings. 35 */ 36 boolean visitLeave( DependencyNode node ); 37 38 }