热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.eclipse.jdt.core.Flags.isInterface()方法的使用及代码示例

本文整理了Java中org.eclipse.jdt.core.Flags.isInterface()方法的一些代码示例,展示了Flags.isInterfa

本文整理了Java中org.eclipse.jdt.core.Flags.isInterface()方法的一些代码示例,展示了Flags.isInterface()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flags.isInterface()方法的具体详情如下:
包路径:org.eclipse.jdt.core.Flags
类名称:Flags
方法名:isInterface

Flags.isInterface介绍

[英]Returns whether the given integer includes the interface modifier.
[中]返回给定整数是否包含interface修饰符。

代码示例

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path, AccessRestriction access) {
if (Flags.isInterface(modifiers)) {
this.nameRequestor.acceptInterface(packageName, simpleTypeName, enclosingTypeNames, path);
} else {
this.nameRequestor.acceptClass(packageName, simpleTypeName, enclosingTypeNames, path);
}
}
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path, AccessRestriction access) {
if (Flags.isInterface(modifiers)) {
this.nameRequestor.acceptInterface(packageName, simpleTypeName, enclosingTypeNames, path);
} else {
this.nameRequestor.acceptClass(packageName, simpleTypeName, enclosingTypeNames, path);
}
}
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path, AccessRestriction access) {
if (Flags.isInterface(modifiers)) {
this.nameRequestor.acceptInterface(packageName, simpleTypeName, enclosingTypeNames, path);
} else {
this.nameRequestor.acceptClass(packageName, simpleTypeName, enclosingTypeNames, path);
}
}
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path, AccessRestriction access) {
if (Flags.isInterface(modifiers)) {
this.nameRequestor.acceptInterface(packageName, simpleTypeName, enclosingTypeNames, path);
} else {
this.nameRequestor.acceptClass(packageName, simpleTypeName, enclosingTypeNames, path);
}
}
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

private boolean isInterface(IType type) {
int flags = getCachedFlags(type);
if (flags == -1) {
try {
return type.isInterface();
} catch (JavaModelException e) {
return false;
}
} else {
return Flags.isInterface(flags);
}
}
/**

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path, AccessRestriction access) {
if (Flags.isInterface(modifiers)) {
this.nameRequestor.acceptInterface(packageName, simpleTypeName, enclosingTypeNames, path);
} else {
this.nameRequestor.acceptClass(packageName, simpleTypeName, enclosingTypeNames, path);
}
}
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

private boolean isInterface(IType type) {
int flags = getCachedFlags(type);
if (flags == -1) {
try {
return type.isInterface();
} catch (JavaModelException e) {
return false;
}
} else {
return Flags.isInterface(flags);
}
}
/**

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

private boolean isInterface(IType type) {
int flags = getCachedFlags(type);
if (flags == -1) {
try {
return type.isInterface();
} catch (JavaModelException e) {
return false;
}
} else {
return Flags.isInterface(flags);
}
}
/**

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private ImageDescriptor getOverlayFromFlags(int flags) {
if (Flags.isAnnotation(flags)) {
return JavaPluginImages.DESC_OVR_ANNOTATION;
} else if (Flags.isEnum(flags)) {
return JavaPluginImages.DESC_OVR_ENUM;
} else if (Flags.isInterface(flags)) {
return JavaPluginImages.DESC_OVR_INTERFACE;
} else if (/* is class */ Flags.isAbstract(flags)) {
return JavaPluginImages.DESC_OVR_ABSTRACT_CLASS;
}
return null;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private boolean isOfKind(TypeNameMatch curr, int typeKinds, boolean is50OrHigher) {
int flags= curr.getModifiers();
if (Flags.isAnnotation(flags)) {
return is50OrHigher && (typeKinds & TypeKinds.ANNOTATIONS) != 0;
}
if (Flags.isEnum(flags)) {
return is50OrHigher && (typeKinds & TypeKinds.ENUMS) != 0;
}
if (Flags.isInterface(flags)) {
return (typeKinds & TypeKinds.INTERFACES) != 0;
}
return (typeKinds & TypeKinds.CLASSES) != 0;
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private boolean isOfKind(TypeNameMatch curr, int typeKinds, boolean is50OrHigher) {
int flags= curr.getModifiers();
if (Flags.isAnnotation(flags)) {
return is50OrHigher && ((typeKinds & SimilarElementsRequestor.ANNOTATIONS) != 0);
}
if (Flags.isEnum(flags)) {
return is50OrHigher && ((typeKinds & SimilarElementsRequestor.ENUMS) != 0);
}
if (Flags.isInterface(flags)) {
return (typeKinds & SimilarElementsRequestor.INTERFACES) != 0;
}
return (typeKinds & SimilarElementsRequestor.CLASSES) != 0;
}

代码示例来源:origin: org.eclipse/org.eclipse.ajdt.ui

private boolean isOfKind(TypeNameMatch curr, int typeKinds, boolean is50OrHigher) {
int flags= curr.getModifiers();
if (Flags.isAnnotation(flags)) {
return is50OrHigher && ((typeKinds & SimilarElementsRequestor.ANNOTATIONS) != 0);
}
if (Flags.isEnum(flags)) {
return is50OrHigher && ((typeKinds & SimilarElementsRequestor.ENUMS) != 0);
}
if (Flags.isInterface(flags)) {
return (typeKinds & SimilarElementsRequestor.INTERFACES) != 0;
}
return (typeKinds & SimilarElementsRequestor.CLASSES) != 0;
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private boolean isOfKind(TypeNameMatch curr, int typeKinds, boolean is50OrHigher) {
int flags= curr.getModifiers();
if (Flags.isAnnotation(flags)) {
return is50OrHigher && ((typeKinds & SimilarElementsRequestor.ANNOTATIONS) != 0);
}
if (Flags.isEnum(flags)) {
return is50OrHigher && ((typeKinds & SimilarElementsRequestor.ENUMS) != 0);
}
if (Flags.isInterface(flags)) {
return (typeKinds & SimilarElementsRequestor.INTERFACES) != 0;
}
return (typeKinds & SimilarElementsRequestor.CLASSES) != 0;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private boolean isOfKind(TypeNameMatch curr, int typeKinds, boolean is50OrHigher) {
int flags= curr.getModifiers();
if (Flags.isAnnotation(flags)) {
return is50OrHigher && (typeKinds & SimilarElementsRequestor.ANNOTATIONS) != 0;
}
if (Flags.isEnum(flags)) {
return is50OrHigher && (typeKinds & SimilarElementsRequestor.ENUMS) != 0;
}
if (Flags.isInterface(flags)) {
return (typeKinds & SimilarElementsRequestor.INTERFACES) != 0;
}
return (typeKinds & SimilarElementsRequestor.CLASSES) != 0;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private boolean isOfKind(TypeNameMatch curr, int typeKinds, boolean is50OrHigher) {
int flags= curr.getModifiers();
if (Flags.isAnnotation(flags)) {
return is50OrHigher && (typeKinds & SimilarElementsRequestor.ANNOTATIONS) != 0;
}
if (Flags.isEnum(flags)) {
return is50OrHigher && (typeKinds & SimilarElementsRequestor.ENUMS) != 0;
}
if (Flags.isInterface(flags)) {
return (typeKinds & SimilarElementsRequestor.INTERFACES) != 0;
}
return (typeKinds & SimilarElementsRequestor.CLASSES) != 0;
}

代码示例来源:origin: org.eclipse.jdt.junit/core

public static void findTestImplementorClasses(ITypeHierarchy typeHierarchy, IType testInterface, IRegion region, Set result)
throws JavaModelException {
IType[] subtypes= typeHierarchy.getAllSubtypes(testInterface);
for (int i= 0; i IType type= subtypes[i];
int cachedFlags= typeHierarchy.getCachedFlags(type);
if (!Flags.isInterface(cachedFlags) && !Flags.isAbstract(cachedFlags) // do the cheaper tests first
&& region.contains(type) && CoreTestSearchEngine.isAccessibleClass(type)) {
result.add(type);
}
}
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.junit.core

public static void findTestImplementorClasses(ITypeHierarchy typeHierarchy, IType testInterface, IRegion region, Set result)
throws JavaModelException {
IType[] subtypes= typeHierarchy.getAllSubtypes(testInterface);
for (int i= 0; i IType type= subtypes[i];
int cachedFlags= typeHierarchy.getCachedFlags(type);
if (!Flags.isInterface(cachedFlags) && !Flags.isAbstract(cachedFlags) // do the cheaper tests first
&& region.contains(type) && CoreTestSearchEngine.isAccessibleClass(type)) {
result.add(type);
}
}
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

ImageDescriptor createTypeImageDescriptor(CompletionProposal proposal) {
final int flags= proposal.getFlags();
boolean isInterfaceOrAnnotation= Flags.isInterface(flags) || Flags.isAnnotation(flags);
return decorateImageDescriptor(JavaElementImageProvider.getTypeImageDescriptor(true /* in order to get all visibility decorations */, isInterfaceOrAnnotation, flags, false), proposal);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

ImageDescriptor createTypeImageDescriptor(CompletionProposal proposal) {
final int flags= proposal.getFlags();
boolean isInterfaceOrAnnotation= Flags.isInterface(flags) || Flags.isAnnotation(flags);
return decorateImageDescriptor(JavaElementImageProvider.getTypeImageDescriptor(true /* in order to get all visibility decorations */, isInterfaceOrAnnotation, flags, false), proposal);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

ImageDescriptor createTypeImageDescriptor(CompletionProposal proposal) {
final int flags= proposal.getFlags();
boolean isInterfaceOrAnnotation= Flags.isInterface(flags) || Flags.isAnnotation(flags);
return decorateImageDescriptor(JavaElementImageProvider.getTypeImageDescriptor(true /* in order to get all visibility decorations */, isInterfaceOrAnnotation, flags, false), proposal);
}

推荐阅读
author-avatar
骨Zi骄傲
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有