当前位置: 首页>>代码示例>>Java>>正文


Java DependencyNode.getParent方法代码示例

本文整理汇总了Java中org.apache.maven.shared.dependency.tree.DependencyNode.getParent方法的典型用法代码示例。如果您正苦于以下问题:Java DependencyNode.getParent方法的具体用法?Java DependencyNode.getParent怎么用?Java DependencyNode.getParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.maven.shared.dependency.tree.DependencyNode的用法示例。


在下文中一共展示了DependencyNode.getParent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: markParent

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入方法依赖的package包/类
/**
 * Recursively sets the {@link Result}s of all parents of the given node as
 * having {@link Result#badDep()}.
 *
 * @param badDependency A failed {@link DependencyNode}.
 */
private void markParent(final DependencyNode badDependency) {
	final DependencyNode parent = badDependency.getParent();

	if (parent != null && !isRoot(parent)) {
		final Result r = results.get(parent);
		// badDep returns the value previously set for the Result#dep field.
		// We only set badDep here, thus if it was already true we know we've
		// already ascended this path before and do not need to recurse further.
		if (!r.badDep()) markParent(parent);
	}
}
 
开发者ID:scijava,项目名称:scijava-maven-plugin,代码行数:18,代码来源:SnapshotFinder.java

示例2: isRoot

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入方法依赖的package包/类
@Override
public boolean isRoot(final DependencyNode node) {
	return node.getParent() == null;
}
 
开发者ID:scijava,项目名称:scijava-maven-plugin,代码行数:5,代码来源:AbstractSciJavaDependencyChecker.java

示例3: initialize

import org.apache.maven.shared.dependency.tree.DependencyNode; //导入方法依赖的package包/类
private void initialize () {
    targets2Versions = new HashMap<Artifact, Set<ArtifactVersion>>();
    targets2ConfPar = new HashMap<Artifact, Set<DependencyNode>>();
    DependencyNode curDn = null;
    DependencyNode parent = null;

    List<DependencyNode> allDNs = new ArrayList<DependencyNode>(
            conflictNode.getDuplicatesOrConflicts());
    
    // prevent conflictNode itself to be included in exclusion targets
    if (conflictNode.getPrimaryLevel() > 1) {
        allDNs.add(conflictNode.getArtifact());
    }

    for (DependencyNode dn : allDNs) {
        curDn = dn;
        parent = curDn.getParent();
        // bad luck with no parent...
        if (parent == null) {
            continue;
        }
        while (parent.getParent() != null) {
            parent = parent.getParent();
            curDn = curDn.getParent();
        }
        
        Set<DependencyNode> confPar = targets2ConfPar.get(curDn.getArtifact());
        if (confPar == null) {
            confPar = new HashSet<DependencyNode>();
            targets2ConfPar.put(curDn.getArtifact(), confPar);
        }
        confPar.add(dn.getParent());

        Set<ArtifactVersion> versions = targets2Versions.get(curDn.getArtifact());
        if (versions == null) {
            versions = new HashSet<ArtifactVersion>();
            targets2Versions.put(curDn.getArtifact(), versions);
        }
        versions.add(new DefaultArtifactVersion(dn.getArtifact().getVersion()));
    }
}
 
开发者ID:timboudreau,项目名称:vl-jung,代码行数:42,代码来源:FixVersionConflictPanel.java


注:本文中的org.apache.maven.shared.dependency.tree.DependencyNode.getParent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。