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


Java ReferenceBinding.isSuperclassOf方法代码示例

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


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

示例1: removeCaughtException

import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
private void removeCaughtException(ReferenceBinding caughtException) {
	Object[] exceptions = this.thrownExceptions.values;
	for (int i = 0; i < exceptions.length; i++) {
		ReferenceBinding exception = (ReferenceBinding)exceptions[i];
		if (exception != null) {
			if (TypeBinding.equalsEquals(exception, caughtException)) {
				this.thrownExceptions.remove(exception);
			} else if (caughtException.isSuperclassOf(exception)) {
				// catching the sub-exception when super has been caught already will give an error
				// so remove it from thrown list and lower the relevance for cases when it is found
				// from searchAllTypes(..)
				this.thrownExceptions.remove(exception);
				this.discouragedExceptions.add(exception);
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:ThrownExceptionFinder.java

示例2: removeCaughtException

import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
private void removeCaughtException(ReferenceBinding caughtException) {
	Object[] exceptions = this.thrownExceptions.values;
	for (int i = 0; i < exceptions.length; i++) {
		ReferenceBinding exception = (ReferenceBinding)exceptions[i];
		if (exception != null) {
			if (exception == caughtException) {
				this.thrownExceptions.remove(exception);
			} else if (caughtException.isSuperclassOf(exception)) {
				// catching the sub-exception when super has been caught already will give an error
				// so remove it from thrown list and lower the relevance for cases when it is found
				// from searchAllTypes(..)
				this.thrownExceptions.remove(exception);
				this.discouragedExceptions.add(exception);
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:18,代码来源:ThrownExceptionFinder.java

示例3: canBeSeenByForCodeSnippet

import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
public final boolean canBeSeenByForCodeSnippet(ReferenceBinding referenceBinding, ReferenceBinding receiverType) {
	if (referenceBinding.isPublic()) return true;

	if (TypeBinding.equalsEquals(receiverType, referenceBinding)) return true;

	if (referenceBinding.isProtected()) {
		// answer true if the receiver (or its enclosing type) is the superclass
		//	of the receiverType or in the same package
		return receiverType.fPackage == referenceBinding.fPackage
				|| referenceBinding.isSuperclassOf(receiverType)
				|| referenceBinding.enclosingType().isSuperclassOf(receiverType); // protected types always have an enclosing one
	}

	if (referenceBinding.isPrivate()) {
		// answer true if the receiver and the receiverType have a common enclosingType
		// already know they are not the identical type
		ReferenceBinding outerInvocationType = receiverType;
		ReferenceBinding temp = outerInvocationType.enclosingType();
		while (temp != null) {
			outerInvocationType = temp;
			temp = temp.enclosingType();
		}

		ReferenceBinding outerDeclaringClass = referenceBinding;
		temp = outerDeclaringClass.enclosingType();
		while (temp != null) {
			outerDeclaringClass = temp;
			temp = temp.enclosingType();
		}
		return TypeBinding.equalsEquals(outerInvocationType, outerDeclaringClass);
	}

	// isDefault()
	return receiverType.fPackage == referenceBinding.fPackage;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:36,代码来源:CodeSnippetScope.java

示例4: canBeSeenByForCodeSnippet

import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
public final boolean canBeSeenByForCodeSnippet(ReferenceBinding referenceBinding, ReferenceBinding receiverType) {
	if (referenceBinding.isPublic()) return true;

	if (receiverType == referenceBinding) return true;

	if (referenceBinding.isProtected()) {
		// answer true if the receiver (or its enclosing type) is the superclass
		//	of the receiverType or in the same package
		return receiverType.fPackage == referenceBinding.fPackage
				|| referenceBinding.isSuperclassOf(receiverType)
				|| referenceBinding.enclosingType().isSuperclassOf(receiverType); // protected types always have an enclosing one
	}

	if (referenceBinding.isPrivate()) {
		// answer true if the receiver and the receiverType have a common enclosingType
		// already know they are not the identical type
		ReferenceBinding outerInvocationType = receiverType;
		ReferenceBinding temp = outerInvocationType.enclosingType();
		while (temp != null) {
			outerInvocationType = temp;
			temp = temp.enclosingType();
		}

		ReferenceBinding outerDeclaringClass = referenceBinding;
		temp = outerDeclaringClass.enclosingType();
		while (temp != null) {
			outerDeclaringClass = temp;
			temp = temp.enclosingType();
		}
		return outerInvocationType == outerDeclaringClass;
	}

	// isDefault()
	return receiverType.fPackage == referenceBinding.fPackage;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:36,代码来源:CodeSnippetScope.java


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