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


Java CodeTreeNodeType类代码示例

本文整理汇总了Java中com.blackducksoftware.sdk.protex.project.codetree.CodeTreeNodeType的典型用法代码示例。如果您正苦于以下问题:Java CodeTreeNodeType类的具体用法?Java CodeTreeNodeType怎么用?Java CodeTreeNodeType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CodeTreeNodeType类属于com.blackducksoftware.sdk.protex.project.codetree包,在下文中一共展示了CodeTreeNodeType类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getStringSearchDiscoveries

import com.blackducksoftware.sdk.protex.project.codetree.CodeTreeNodeType; //导入依赖的package包/类
public List<StringSearchDiscovery> getStringSearchDiscoveries(String projectID, String path) {
	CodeTreeNode tmpCodeTreeNode = new CodeTreeNode();
	tmpCodeTreeNode.setNodeType(CodeTreeNodeType.FILE);
	tmpCodeTreeNode.setName(path);
	
	PartialCodeTree fileOnlyTree = new PartialCodeTree();
	fileOnlyTree.setParentPath("/");
       fileOnlyTree.getNodes().add(tmpCodeTreeNode);
	
	List<StringSearchPatternOriginType> searchOnly = new ArrayList<StringSearchPatternOriginType>(1);
	searchOnly.add(StringSearchPatternOriginType.STANDARD);
	searchOnly.add(StringSearchPatternOriginType.CUSTOM);
	
	try {
		return this.discoveryAPI.getStringSearchDiscoveries(projectID, fileOnlyTree, searchOnly);
	} catch (SdkFault e) {
		log.error(e.getMessage());
	}
	
	return null;	
}
 
开发者ID:spdx,项目名称:ATTIC-osit,代码行数:22,代码来源:ProtexSDKAPIService.java

示例2: compare

import com.blackducksoftware.sdk.protex.project.codetree.CodeTreeNodeType; //导入依赖的package包/类
@Override
public int compare(CodeTreeNode arg0, CodeTreeNode arg1) {
	if(arg0.getNodeType() != arg1.getNodeType()) {
		return (arg0.getNodeType() == CodeTreeNodeType.FILE)?1:-1;
	} else {
		return arg0.getName().compareTo(arg1.getName());
	}
}
 
开发者ID:spdx,项目名称:ATTIC-osit,代码行数:9,代码来源:JTreeAllFiles.java

示例3: treeWalk

import com.blackducksoftware.sdk.protex.project.codetree.CodeTreeNodeType; //导入依赖的package包/类
public void treeWalk(String parentPath) throws SdkFault {
	log.debug("treeWalk: "+parentPath);

    PartialCodeTree thisLevel = mCodeTreeAPI.getCodeTree(mProjectID, parentPath, CodeTreeUtilities.DIRECT_CHILDREN, Boolean.FALSE);
    // Deal with all the sub-folders first

    for (CodeTreeNode node : thisLevel.getNodes()) {
    	
        if ((node.getNodeType() == CodeTreeNodeType.EXPANDED_ARCHIVE) || (node.getNodeType() == CodeTreeNodeType.FOLDER)) {
        	treeWalk(constructPath(parentPath, node.getName()));
        }
    }
    
    doWork(thisLevel);
}
 
开发者ID:spdx,项目名称:ATTIC-osit,代码行数:16,代码来源:BOMReportAPIWrapper.java

示例4: preprocess

import com.blackducksoftware.sdk.protex.project.codetree.CodeTreeNodeType; //导入依赖的package包/类
protected static String preprocess(CodeTreeNode node) {
    return (node.getNodeType() != CodeTreeNodeType.FILE ? node.getName() + "/" : node.getName()).replaceAll("([^/]*)/+", "\0$1/");
}
 
开发者ID:blackducksoftware,项目名称:sdk-client-tools-protex,代码行数:4,代码来源:CodeTreeNodeComparator.java

示例5: doWork

import com.blackducksoftware.sdk.protex.project.codetree.CodeTreeNodeType; //导入依赖的package包/类
private void doWork(PartialCodeTree thisLevel) throws SdkFault {
    // do the work here
    if (thisLevel.getNodes().size() == 0) {
        return;
    }
    PartialCodeTree fileNodes = new PartialCodeTree();
    fileNodes.setParentPath(thisLevel.getParentPath());
    for (CodeTreeNode node : thisLevel.getNodes()) {
        if (node.getNodeType() == CodeTreeNodeType.FILE) {
            fileNodes.getNodes().add(node);
        }
    }
    if (fileNodes.getNodes().size() == 0) {
        return;
    }
    
    List<CodeTreeIdentificationInfo> idInfos = mIdentificationAPI.getEffectiveIdentifications(mProjectID,fileNodes);
    for (CodeTreeIdentificationInfo idInfo : idInfos) {
        String filePath = constructPath(thisLevel.getParentPath(), idInfo.getName());
    	for (Identification id : idInfo.getIdentifications()) {
    		String mComponentID = id.getIdentifiedComponentId();
	        Component mComponent = mProjectAPI.getComponentById(mProjectID, mComponentID);
	        if(mComponent == null) continue;
	        String mComponentName = mComponent.getName();
	        String fileComment = mCodeTreeAPI.getFileOrFolderComment(mProjectID, filePath);
	
	        String fileLicense = "";
	        LicenseInfo mLicenseInfo = id.getIdentifiedLicenseInfo();
	        if(mLicenseInfo != null) fileLicense = parseFileLicense(mLicenseInfo.getName());
	        
	        IdentificationType discoveryType = id.getType();
	        
	        String mIndetifyURL = mBomAPI.getIdentifyBomUrl(mProjectID,filePath);
	        log.debug("-- " + filePath + " : " + mIndetifyURL);
	
	        identifiedFileList.add(new IdentifiedFilesRow(filePath, mComponentName, fileComment, fileLicense, mProjectName, discoveryType.toString()));

String msg = "    "+ identifiedFileList.size() + " files are loaded.";    	        
observer.pushMessage(msg);
log.debug(msg);
    	}
    }
}
 
开发者ID:spdx,项目名称:ATTIC-osit,代码行数:44,代码来源:BOMReportAPIWrapper.java

示例6: setBase

import com.blackducksoftware.sdk.protex.project.codetree.CodeTreeNodeType; //导入依赖的package包/类
public void setBase() {
	/** Common **/
       fileOnlyTree.setParentPath("/");
       fileOnlyTree.getNodes().add(tmpCodeTreeNode);
   	tmpCodeTreeNode.setNodeType(CodeTreeNodeType.FILE);
}
 
开发者ID:spdx,项目名称:ATTIC-osit,代码行数:7,代码来源:CommonIdentify.java


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