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


Java ReferenceBinding.isValidBinding方法代码示例

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


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

示例1: getEnclosedElements

import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
@Override
public List<? extends Element> getEnclosedElements() {
	PackageBinding binding = (PackageBinding)_binding;
	LookupEnvironment environment = binding.environment;
	char[][][] typeNames = null;
	INameEnvironment nameEnvironment = binding.environment.nameEnvironment;
	if (nameEnvironment instanceof FileSystem) {
		typeNames = ((FileSystem) nameEnvironment).findTypeNames(binding.compoundName);
	}
	HashSet<Element> set = new HashSet<Element>(); 
	if (typeNames != null) {
		for (char[][] typeName : typeNames) {
			ReferenceBinding type = environment.getType(typeName);
			if (type != null && type.isValidBinding()) {
				set.add(_env.getFactory().newElement(type));
			}
		}
	}
	ArrayList<Element> list = new ArrayList<Element>(set.size());
	list.addAll(set);
	return Collections.unmodifiableList(list);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:PackageElementImpl.java

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

示例3: getAnnotationBindings

import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
@Override
protected AnnotationBinding[] getAnnotationBindings()
{
	PackageBinding packageBinding = (PackageBinding) this._binding;
	char[][] compoundName = CharOperation.arrayConcat(packageBinding.compoundName, TypeConstants.PACKAGE_INFO_NAME);
	ReferenceBinding type = this._env.getLookupEnvironment().getType(compoundName);
	AnnotationBinding[] annotations = null;
	if (type != null && type.isValidBinding()) {
		annotations = type.getAnnotations();
	}
	return annotations;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:PackageElementImpl.java

示例4: findGroundTargetType

import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
private ReferenceBinding findGroundTargetType(BlockScope blockScope, ReferenceBinding targetType, boolean argumentTypesElided) {
	if (!targetType.isValidBinding())
		return null;
	ParameterizedTypeBinding withWildCards = InferenceContext18.parameterizedWithWildcard(targetType);
	if (withWildCards != null) {
		if (!argumentTypesElided)
			return new InferenceContext18(blockScope).inferFunctionalInterfaceParameterization(this, blockScope, withWildCards);
		else
			return findGroundTargetTypeForElidedLambda(blockScope, withWildCards);
	}
	return targetType;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:LambdaExpression.java

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

示例6: acceptException

import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
private void acceptException(ReferenceBinding binding) {
	if (binding != null && binding.isValidBinding()) {
		this.thrownExceptions.add(binding);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:6,代码来源:ThrownExceptionFinder.java


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