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