/** * Creates a new dependency node for the specified artifact and appends it to the current parent dependency node. * * @param artifact the attached artifact for the new dependency node * @return the new dependency node */ private DependencyNode createNode( Artifact artifact ) { DependencyNode node = new DependencyNode( artifact ); if ( !parentNodes.isEmpty() ) { DependencyNode parent = parentNodes.peek(); parent.addChild( node ); } return node; }
/** * Creates a new dependency node for the specified artifact and appends it to the current parent dependency node. * * @param artifact * the attached artifact for the new dependency node * @return the new dependency node */ private DependencyNode createNode( Artifact artifact ) { DependencyNode node = new DependencyNode( artifact ); if ( !parentNodes.isEmpty() ) { DependencyNode parent = ( DependencyNode ) parentNodes.peek(); parent.addChild( node ); } return node; }
/** * {@inheritDoc} */ public boolean visit( DependencyNode node ) { // clone the node DependencyNode newNode = new DependencyNode( node.getArtifact(), node.getState(), node.getRelatedArtifact() ); newNode.setOriginalScope( node.getOriginalScope() ); newNode.setFailedUpdateScope( node.getFailedUpdateScope() ); newNode.setPremanagedVersion( node.getPremanagedVersion() ); newNode.setPremanagedScope( node.getPremanagedScope() ); if ( parentNodes.empty() ) { rootNode = newNode; } else { DependencyNode parentNode = parentNodes.peek(); parentNode.addChild( newNode ); } parentNodes.push( newNode ); return true; }