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

x33g5p2x  于2022-01-19 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(182)

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

Flags.isAnnotation介绍

[英]Returns whether the given integer has the AccAnnotation bit set.
[中]返回给定整数是否设置了AccAnnotation位。

代码示例

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

public static boolean isAnnotation(IMember member) throws JavaModelException{
  return Flags.isAnnotation(member.getFlags());
}

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

public static boolean isAnnotation(IMember member) throws JavaModelException{
  return Flags.isAnnotation(member.getFlags());
}

代码示例来源: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/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/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.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/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.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/org.eclipse.jdt.ui

public static boolean isChangeSignatureAvailable(final IMethod method) throws JavaModelException {
  return Checks.isAvailable(method) && !Flags.isAnnotation(method.getDeclaringType().getFlags());
}

代码示例来源: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.jdt/org.eclipse.jdt.core.manipulation

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.jdt/org.eclipse.jdt.ui

public static boolean isChangeSignatureAvailable(final IMethod method) throws JavaModelException {
  return Checks.isAvailable(method) && !Flags.isAnnotation(method.getDeclaringType().getFlags());
}

代码示例来源: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/org.eclipse.jdt.ui

private static final int getKind(int flags, char[] typeNameSig) {
  if (Signature.getTypeSignatureKind(typeNameSig) == Signature.TYPE_VARIABLE_SIGNATURE) {
    return VARIABLES;
  }
  if (Flags.isAnnotation(flags)) {
    return ANNOTATIONS;
  }
  if (Flags.isInterface(flags)) {
    return INTERFACES;
  }
  if (Flags.isEnum(flags)) {
    return ENUMS;
  }
  return CLASSES;
}

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

private SymbolKind mapKind(TypeNameMatch match) {
    int flags= match.getModifiers();
    if (Flags.isInterface(flags)) {
      return SymbolKind.Interface;
    }
    if (Flags.isAnnotation(flags)) {
      return SymbolKind.Property;
    }
    if (Flags.isEnum(flags)) {
      return SymbolKind.Enum;
    }
    return SymbolKind.Class;
  }
}, IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, monitor);

代码示例来源: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);
}

相关文章