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

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

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

Flags.isProtected介绍

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

代码示例

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

private static ImageDescriptor getEnumImageDescriptor(int flags) {
  if (Flags.isPublic(flags) || Flags.isProtected(flags) || Flags.isPrivate(flags))
    return JavaPluginImages.DESC_OBJS_ENUM;
  else
    return JavaPluginImages.DESC_OBJS_ENUM_DEFAULT;
}

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

private static ImageDescriptor getAnnotationImageDescriptor(int flags) {
  if (Flags.isPublic(flags) || Flags.isProtected(flags) || Flags.isPrivate(flags))
    return JavaPluginImages.DESC_OBJS_ANNOTATION;
  else
    return JavaPluginImages.DESC_OBJS_ANNOTATION_DEFAULT;
}

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

private static ImageDescriptor getInnerInterfaceImageDescriptor(boolean isInInterfaceOrAnnotation, int flags) {
    if (Flags.isPublic(flags) || isInInterfaceOrAnnotation)
      return JavaPluginImages.DESC_OBJS_INNER_INTERFACE_PUBLIC;
    else if (Flags.isPrivate(flags))
      return JavaPluginImages.DESC_OBJS_INNER_INTERFACE_PRIVATE;
    else if (Flags.isProtected(flags))
      return JavaPluginImages.DESC_OBJS_INNER_INTERFACE_PROTECTED;
    else
      return JavaPluginImages.DESC_OBJS_INTERFACE_DEFAULT;
  }
}

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

private static ImageDescriptor getEnumImageDescriptor(int flags) {
  if (Flags.isPublic(flags) || Flags.isProtected(flags) || Flags.isPrivate(flags))
    return JavaPluginImages.DESC_OBJS_ENUM;
  else
    return JavaPluginImages.DESC_OBJS_ENUM_DEFAULT;
}

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

private static ImageDescriptor getInnerAnnotationImageDescriptor(boolean isInInterfaceOrAnnotation, int flags) {
  if (Flags.isPublic(flags) || isInInterfaceOrAnnotation)
    return JavaPluginImages.DESC_OBJS_ANNOTATION;
  else if (Flags.isPrivate(flags))
    return JavaPluginImages.DESC_OBJS_ANNOTATION_PRIVATE;
  else if (Flags.isProtected(flags))
    return JavaPluginImages.DESC_OBJS_ANNOTATION_PROTECTED;
  else
    return JavaPluginImages.DESC_OBJS_ANNOTATION_DEFAULT;
}

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

private static ImageDescriptor getClassImageDescriptor(int flags) {
  if (Flags.isPublic(flags) || Flags.isProtected(flags) || Flags.isPrivate(flags))
    return JavaPluginImages.DESC_OBJS_CLASS;
  else
    return JavaPluginImages.DESC_OBJS_CLASS_DEFAULT;
}

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

private static ImageDescriptor getInnerClassImageDescriptor(boolean isInInterfaceOrAnnotation, int flags) {
  if (Flags.isPublic(flags) || isInInterfaceOrAnnotation)
    return JavaPluginImages.DESC_OBJS_INNER_CLASS_PUBLIC;
  else if (Flags.isPrivate(flags))
    return JavaPluginImages.DESC_OBJS_INNER_CLASS_PRIVATE;
  else if (Flags.isProtected(flags))
    return JavaPluginImages.DESC_OBJS_INNER_CLASS_PROTECTED;
  else
    return JavaPluginImages.DESC_OBJS_INNER_CLASS_DEFAULT;
}

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

private static ImageDescriptor getInnerClassImageDescriptor(boolean isInInterfaceOrAnnotation, int flags) {
  if (Flags.isPublic(flags) || isInInterfaceOrAnnotation)
    return JavaPluginImages.DESC_OBJS_INNER_CLASS_PUBLIC;
  else if (Flags.isPrivate(flags))
    return JavaPluginImages.DESC_OBJS_INNER_CLASS_PRIVATE;
  else if (Flags.isProtected(flags))
    return JavaPluginImages.DESC_OBJS_INNER_CLASS_PROTECTED;
  else
    return JavaPluginImages.DESC_OBJS_INNER_CLASS_DEFAULT;
}

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

private static ImageDescriptor getInnerEnumImageDescriptor(boolean isInInterfaceOrAnnotation, int flags) {
  if (Flags.isPublic(flags) || isInInterfaceOrAnnotation)
    return JavaPluginImages.DESC_OBJS_ENUM;
  else if (Flags.isPrivate(flags))
    return JavaPluginImages.DESC_OBJS_ENUM_PRIVATE;
  else if (Flags.isProtected(flags))
    return JavaPluginImages.DESC_OBJS_ENUM_PROTECTED;
  else
    return JavaPluginImages.DESC_OBJS_ENUM_DEFAULT;
}

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

private static ImageDescriptor getInnerAnnotationImageDescriptor(boolean isInInterfaceOrAnnotation, int flags) {
  if (Flags.isPublic(flags) || isInInterfaceOrAnnotation)
    return JavaPluginImages.DESC_OBJS_ANNOTATION;
  else if (Flags.isPrivate(flags))
    return JavaPluginImages.DESC_OBJS_ANNOTATION_PRIVATE;
  else if (Flags.isProtected(flags))
    return JavaPluginImages.DESC_OBJS_ANNOTATION_PROTECTED;
  else
    return JavaPluginImages.DESC_OBJS_ANNOTATION_DEFAULT;
}

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

private static ImageDescriptor getInterfaceImageDescriptor(int flags) {
  if (Flags.isPublic(flags) || Flags.isProtected(flags) || Flags.isPrivate(flags))
    return JavaPluginImages.DESC_OBJS_INTERFACE;
  else
    return JavaPluginImages.DESC_OBJS_INTERFACE_DEFAULT;
}

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

private static ImageDescriptor getAnnotationImageDescriptor(int flags) {
  if (Flags.isPublic(flags) || Flags.isProtected(flags) || Flags.isPrivate(flags))
    return JavaPluginImages.DESC_OBJS_ANNOTATION;
  else
    return JavaPluginImages.DESC_OBJS_ANNOTATION_DEFAULT;
}

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

public static ImageDescriptor getMethodImageDescriptor(boolean isInInterfaceOrAnnotation, int flags) {
  if (Flags.isPublic(flags))
    return JavaPluginImages.DESC_MISC_PUBLIC;
  if (Flags.isProtected(flags))
    return JavaPluginImages.DESC_MISC_PROTECTED;
  if (Flags.isPrivate(flags))
    return JavaPluginImages.DESC_MISC_PRIVATE;
  if (isInInterfaceOrAnnotation)
    return JavaPluginImages.DESC_MISC_PUBLIC;
  return JavaPluginImages.DESC_MISC_DEFAULT;
}

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

private static ImageDescriptor getInnerAnnotationImageDescriptor(boolean isInInterfaceOrAnnotation, int flags) {
  if (Flags.isPublic(flags) || isInInterfaceOrAnnotation)
    return JavaPluginImages.DESC_OBJS_ANNOTATION;
  else if (Flags.isPrivate(flags))
    return JavaPluginImages.DESC_OBJS_ANNOTATION_PRIVATE;
  else if (Flags.isProtected(flags))
    return JavaPluginImages.DESC_OBJS_ANNOTATION_PROTECTED;
  else
    return JavaPluginImages.DESC_OBJS_ANNOTATION_DEFAULT;
}

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

public static ImageDescriptor getFieldImageDescriptor(boolean isInInterfaceOrAnnotation, int flags) {
  if (Flags.isPublic(flags) || isInInterfaceOrAnnotation || Flags.isEnum(flags))
    return JavaPluginImages.DESC_FIELD_PUBLIC;
  if (Flags.isProtected(flags))
    return JavaPluginImages.DESC_FIELD_PROTECTED;
  if (Flags.isPrivate(flags))
    return JavaPluginImages.DESC_FIELD_PRIVATE;
  return JavaPluginImages.DESC_FIELD_DEFAULT;
}

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

private boolean isVisible(TypeNameMatch curr) {
  int flags= curr.getModifiers();
  if (Flags.isPrivate(flags)) {
    return false;
  }
  if (Flags.isPublic(flags) || Flags.isProtected(flags)) {
    return true;
  }
  return curr.getPackageName().equals(fCurrPackage.getElementName());
}

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

private boolean isVisible(TypeNameMatch curr) {
  int flags= curr.getModifiers();
  if (Flags.isPrivate(flags)) {
    return false;
  }
  if (Flags.isPublic(flags) || Flags.isProtected(flags)) {
    return true;
  }
  return curr.getPackageName().equals(fCompilationUnit.getParent().getElementName());
}

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

private boolean isVisible(TypeNameMatch curr, ICompilationUnit cu) {
  int flags= curr.getModifiers();
  if (Flags.isPrivate(flags)) {
    return false;
  }
  if (Flags.isPublic(flags) || Flags.isProtected(flags)) {
    return true;
  }
  return curr.getPackageName().equals(cu.getParent().getElementName());
}

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

private boolean isVisible(TypeNameMatch curr) {
  int flags= curr.getModifiers();
  if (Flags.isPrivate(flags)) {
    return false;
  }
  if (Flags.isPublic(flags) || Flags.isProtected(flags)) {
    return true;
  }
  return curr.getPackageName().equals(fCompilationUnit.getParent().getElementName());
}

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

private boolean isVisible(TypeNameMatch curr, ICompilationUnit cu) {
  int flags= curr.getModifiers();
  if (Flags.isPrivate(flags)) {
    return false;
  }
  if (Flags.isPublic(flags) || Flags.isProtected(flags)) {
    return true;
  }
  return curr.getPackageName().equals(cu.getParent().getElementName());
}

相关文章