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


Java ReferenceBinding.isRawType方法代码示例

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


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

示例1: isFromSource

import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
public boolean isFromSource() {
	if (isClass() || isInterface() || isEnum()) {
		ReferenceBinding referenceBinding = (ReferenceBinding) this.binding;
		if (referenceBinding.isRawType()) {
			return !((RawTypeBinding) referenceBinding).genericType().isBinaryBinding();
		} else if (referenceBinding.isParameterizedType()) {
			ParameterizedTypeBinding parameterizedTypeBinding = (ParameterizedTypeBinding) referenceBinding;
			org.eclipse.jdt.internal.compiler.lookup.TypeBinding erasure = parameterizedTypeBinding.erasure();
			if (erasure instanceof ReferenceBinding) {
				return !((ReferenceBinding) erasure).isBinaryBinding();
			}
			return false;
		} else {
			return !referenceBinding.isBinaryBinding();
		}
	} else if (isTypeVariable()) {
		final TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
		final Binding declaringElement = typeVariableBinding.declaringElement;
		if (declaringElement instanceof MethodBinding) {
			MethodBinding methodBinding = (MethodBinding) declaringElement;
			return !methodBinding.declaringClass.isBinaryBinding();
		} else {
			final org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding = (org.eclipse.jdt.internal.compiler.lookup.TypeBinding) declaringElement;
			if (typeBinding instanceof ReferenceBinding) {
				return !((ReferenceBinding) typeBinding).isBinaryBinding();
			} else if (typeBinding instanceof ArrayBinding) {
				final ArrayBinding arrayBinding = (ArrayBinding) typeBinding;
				final org.eclipse.jdt.internal.compiler.lookup.TypeBinding leafComponentType = arrayBinding.leafComponentType;
				if (leafComponentType instanceof ReferenceBinding) {
					return !((ReferenceBinding) leafComponentType).isBinaryBinding();
				}
			}
		}

	} else if (isCapture()) {
		CaptureBinding captureBinding = (CaptureBinding) this.binding;
		return !captureBinding.sourceType.isBinaryBinding();
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:41,代码来源:TypeBinding.java

示例2: isDefaultConstructor

import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
/**
 * @see IMethodBinding#isDefaultConstructor()
 * @since 3.0
 */
public boolean isDefaultConstructor() {
	final ReferenceBinding declaringClassBinding = this.binding.declaringClass;
	if (declaringClassBinding.isRawType()) {
		RawTypeBinding rawTypeBinding = (RawTypeBinding) declaringClassBinding;
		if (rawTypeBinding.genericType().isBinaryBinding()) {
			return false;
		}
		return (this.binding.modifiers & ExtraCompilerModifiers.AccIsDefaultConstructor) != 0;
	}
	if (declaringClassBinding.isBinaryBinding()) {
		return false;
	}
	return (this.binding.modifiers & ExtraCompilerModifiers.AccIsDefaultConstructor) != 0;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:19,代码来源:MethodBinding.java


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