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


Java ReferenceBinding.isClass方法代码示例

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


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

示例1: getKind

import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
@Override
public ElementKind getKind() {
	if (null != _kindHint) {
		return _kindHint;
	}
	ReferenceBinding refBinding = (ReferenceBinding)_binding;
	// The order of these comparisons is important: e.g., enum is subset of class
	if (refBinding.isEnum()) {
		return ElementKind.ENUM;
	}
	else if (refBinding.isAnnotationType()) {
		return ElementKind.ANNOTATION_TYPE;
	}
	else if (refBinding.isInterface()) {
		return ElementKind.INTERFACE;
	}
	else if (refBinding.isClass()) {
		return ElementKind.CLASS;
	}
	else {
		throw new IllegalArgumentException("TypeElement " + new String(refBinding.shortReadableName()) +  //$NON-NLS-1$
				" has unexpected attributes " + refBinding.modifiers); //$NON-NLS-1$
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:25,代码来源:TypeElementImpl.java

示例2: addAnnotatedElements

import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; //导入方法依赖的package包/类
/**
 * For every type in types that is a class and that is annotated with anno, either directly or by inheritance,
 * add that type to result.  Recursively descend on each types's child classes as well.
 * @param anno the compiler binding for an annotation type
 * @param type a type, not necessarily a class
 * @param result must be a modifiable Set; will accumulate annotated classes
 */
private void addAnnotatedElements(ReferenceBinding anno, ReferenceBinding type, Set<Element> result) {
	if (type.isClass()) {
		if (inheritsAnno(type, anno)) {
			result.add(_factory.newElement(type));
		}
	}
	for (ReferenceBinding element : type.memberTypes()) {
		addAnnotatedElements(anno, element, result);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:RoundEnvImpl.java


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