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


Java ImportBinding类代码示例

本文整理汇总了Java中org.eclipse.jdt.internal.compiler.lookup.ImportBinding的典型用法代码示例。如果您正苦于以下问题:Java ImportBinding类的具体用法?Java ImportBinding怎么用?Java ImportBinding使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ImportBinding类属于org.eclipse.jdt.internal.compiler.lookup包,在下文中一共展示了ImportBinding类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkUnusedImports

import org.eclipse.jdt.internal.compiler.lookup.ImportBinding; //导入依赖的package包/类
public void checkUnusedImports(){
	if (this.scope.imports != null){
		for (int i = 0, max = this.scope.imports.length; i < max; i++){
			ImportBinding importBinding = this.scope.imports[i];
			ImportReference importReference = importBinding.reference;
			if (importReference != null && ((importReference.bits & ASTNode.Used) == 0)){
				this.scope.problemReporter().unusedImport(importReference);
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:12,代码来源:CompilationUnitDeclaration.java

示例2: isEqual

import org.eclipse.jdt.internal.compiler.lookup.ImportBinding; //导入依赖的package包/类
/**
 * @param declaringElement
 * @param declaringElement2
 * @return true if both parameters are equals, false otherwise
 */
static boolean isEqual(Binding declaringElement, Binding declaringElement2, HashSet visitedTypes) {
	if (declaringElement instanceof org.eclipse.jdt.internal.compiler.lookup.TypeBinding) {
		if (!(declaringElement2 instanceof org.eclipse.jdt.internal.compiler.lookup.TypeBinding)){
			return false;
		}
		return isEqual((org.eclipse.jdt.internal.compiler.lookup.TypeBinding) declaringElement,
				(org.eclipse.jdt.internal.compiler.lookup.TypeBinding) declaringElement2,
				visitedTypes);
	} else if (declaringElement instanceof org.eclipse.jdt.internal.compiler.lookup.MethodBinding) {
		if (!(declaringElement2 instanceof org.eclipse.jdt.internal.compiler.lookup.MethodBinding)) {
			return false;
		}
		return isEqual((org.eclipse.jdt.internal.compiler.lookup.MethodBinding) declaringElement,
				(org.eclipse.jdt.internal.compiler.lookup.MethodBinding) declaringElement2,
				visitedTypes);
	} else if (declaringElement instanceof VariableBinding) {
		if (!(declaringElement2 instanceof VariableBinding)) {
			return false;
		}
		return isEqual((VariableBinding) declaringElement,
				(VariableBinding) declaringElement2);
	} else if (declaringElement instanceof org.eclipse.jdt.internal.compiler.lookup.PackageBinding) {
		if (!(declaringElement2 instanceof org.eclipse.jdt.internal.compiler.lookup.PackageBinding)) {
			return false;
		}
		org.eclipse.jdt.internal.compiler.lookup.PackageBinding packageBinding = (org.eclipse.jdt.internal.compiler.lookup.PackageBinding) declaringElement;
		org.eclipse.jdt.internal.compiler.lookup.PackageBinding packageBinding2 = (org.eclipse.jdt.internal.compiler.lookup.PackageBinding) declaringElement2;
		return CharOperation.equals(packageBinding.compoundName, packageBinding2.compoundName);
	} else if (declaringElement instanceof ImportBinding) {
		if (!(declaringElement2 instanceof ImportBinding)) {
			return false;
		}
		ImportBinding importBinding = (ImportBinding) declaringElement;
		ImportBinding importBinding2 = (ImportBinding) declaringElement2;
		return importBinding.isStatic() == importBinding2.isStatic()
			&& importBinding.onDemand == importBinding2.onDemand
			&& CharOperation.equals(importBinding.compoundName, importBinding2.compoundName);
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:46,代码来源:BindingComparator.java


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