當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。