本文整理汇总了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);
}
}
}
}
示例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;
}