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