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


Java ReferenceBinding.isBinaryBinding方法代码示例

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


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

示例1: processClassNames

import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
private ReferenceBinding[] processClassNames(LookupEnvironment environment) {
	// check for .class file presence in case of apt processing
	int length = this.classNames.length;
	ReferenceBinding[] referenceBindings = new ReferenceBinding[length];
	for (int i = 0; i < length; i++) {
		String currentName = this.classNames[i];
		char[][] compoundName = null;
		if (currentName.indexOf('.') != -1) {
			// consider names with '.' as fully qualified names
			char[] typeName = currentName.toCharArray();
			compoundName = CharOperation.splitOn('.', typeName);
		} else {
			compoundName = new char[][] { currentName.toCharArray() };
		}
		ReferenceBinding type = environment.getType(compoundName);
		if (type != null && type.isValidBinding()) {
			if (type.isBinaryBinding()) {
				referenceBindings[i] = type;
			}
		} else {
			throw new IllegalArgumentException(
					this.bind("configure.invalidClassName", currentName));//$NON-NLS-1$
		}
	}
	return referenceBindings;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:Main.java

示例2: 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

示例3: 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

示例4: processClassNames

import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
private ReferenceBinding[] processClassNames(LookupEnvironment environment) {
    int length = this.classNames.length;
    ReferenceBinding[] referenceBindings = new ReferenceBinding[length];

    for(int i = 0; i < length; ++i) {
        String currentName = this.classNames[i];
        Object compoundName = null;
        char[][] var8;
        if(currentName.indexOf(46) != -1) {
            char[] type = currentName.toCharArray();
            var8 = CharOperation.splitOn('.', type);
        } else {
            var8 = new char[][]{currentName.toCharArray()};
        }

        ReferenceBinding var9 = environment.getType(var8);
        if(var9 == null || !var9.isValidBinding()) {
            throw new IllegalArgumentException(this.bind("configure.invalidClassName", currentName));
        }

        if(var9.isBinaryBinding()) {
            referenceBindings[i] = var9;
        }
    }

    return referenceBindings;
}
 
开发者ID:DIVERSIFY-project,项目名称:sosiefier,代码行数:28,代码来源:MainCompiler.java


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