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

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

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

Flags.isPackageDefault介绍

[英]Returns whether the given integer does not include one of the public, private, or protected flags.
[中]返回给定整数是否不包含publicprivateprotected标志之一。

代码示例

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools

/**
   * Determine if the flags contain private or package default flags
   *
   * @param flags
   * @return <code>true</code> if the flags are private or default,
   *         <code>false</code> otherwise
   */
  private boolean isNotVisible(int flags) {
    return Flags.isPrivate(flags) || Flags.isPackageDefault(flags);
  }
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools

@Override
public boolean visit(EnumDeclaration node) {
  int flags = node.getModifiers();
  if (node.isMemberTypeDeclaration()) {
    isvisible &= Flags.isPublic(flags);
  } else {
    isvisible &= !Flags.isPrivate(flags) && !Flags.isPackageDefault(flags);
  }
  fStack.push(new Item(getTypeName(node), node.getModifiers(), isvisible));
  return true;
}

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

if (superMethod.isConstructor()
    && !Flags.isPrivate(superMethod.getFlags())
    && !(Flags.isPackageDefault(superMethod.getFlags()) && !declaringType.getPackageFragment().equals(superclass.getPackageFragment()))
    ) {
  int paramCount= superMethod.getNumberOfParameters();

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

if (superMethod.isConstructor()
    && !Flags.isPrivate(superMethod.getFlags())
    && !(Flags.isPackageDefault(superMethod.getFlags()) && !declaringType.getPackageFragment().equals(superclass.getPackageFragment()))
    ) {
  int paramCount= superMethod.getNumberOfParameters();

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools

} else if (Flags.isPrivate(flags)) {
  createTagProblem(item.typename, tag, IElementDescriptor.TYPE, IApiProblem.UNSUPPORTED_TAG_USE, IApiMarkerConstants.UNSUPPORTED_TAG_MARKER_ID, BuilderMessages.TagValidator_a_private_class);
} else if (Flags.isPackageDefault(flags)) {
  createTagProblem(item.typename, tag, IElementDescriptor.TYPE, IApiProblem.UNSUPPORTED_TAG_USE, IApiMarkerConstants.UNSUPPORTED_TAG_MARKER_ID, BuilderMessages.TagValidator_a_package_default_class);
} else if (Flags.isAbstract(flags) && JavadocTagManager.TAG_NOINSTANTIATE.equals(tagname)) {

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools

int flags = field.getModifiers();
boolean isprivate = Flags.isPrivate(flags);
boolean ispackage = Flags.isPackageDefault(flags);
Set<String> supportedtags = getSupportedTagNames(pkind, IApiJavadocTag.MEMBER_FIELD);
switch (pkind) {

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools

} else if (Flags.isPrivate(flags)) {
  createAnnotationProblem(item.typename, node, IElementDescriptor.TYPE, IApiProblem.UNSUPPORTED_ANNOTATION_USE, IApiMarkerConstants.UNSUPPORTED_ANNOTATION_MARKER_ID, BuilderMessages.TagValidator_a_private_class);
} else if (Flags.isPackageDefault(flags)) {
  createAnnotationProblem(item.typename, node, IElementDescriptor.TYPE, IApiProblem.UNSUPPORTED_ANNOTATION_USE, IApiMarkerConstants.UNSUPPORTED_ANNOTATION_MARKER_ID, BuilderMessages.TagValidator_a_package_default_class);
} else if (Flags.isAbstract(flags) && JavadocTagManager.ANNOTATION_NOINSTANTIATE.equals(name)) {

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools

@Override
public boolean visit(TypeDeclaration node) {
  int flags = node.getModifiers();
  if (Flags.isPrivate(flags)) {
    isvisible &= false;
  } else {
    if (node.isMemberTypeDeclaration()) {
      isvisible &= (Flags.isPublic(flags) && Flags.isStatic(flags)) || Flags.isPublic(flags) || Flags.isProtected(flags) || node.isInterface();
    } else {
      isvisible &= (!Flags.isPrivate(flags) && !Flags.isPackageDefault(flags)) || node.isInterface();
    }
  }
  fStack.push(new Item(getTypeName(node), node.getModifiers(), isvisible));
  return true;
}

代码示例来源:origin: org.eclipse.pde.api.tools/ui

if(Flags.isPrivate(flags) || Flags.isPackageDefault(flags)) {
      return true;
if(Flags.isPrivate(flags) || Flags.isPackageDefault(flags)) {
  return true;

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools

int flags = parent.getModifiers();
boolean isprivate = Flags.isPrivate(flags);
boolean ispackage = Flags.isPackageDefault(flags);
Set<String> supportedtags = ApiPlugin.getJavadocTagManager().getAnntationsForType(pkind, IApiJavadocTag.MEMBER_FIELD);
switch (pkind) {

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools

} else if (Flags.isPrivate(mods)) {
  createTagProblem(item.typename, tag, IElementDescriptor.METHOD, IApiProblem.UNSUPPORTED_TAG_USE, IApiMarkerConstants.UNSUPPORTED_TAG_MARKER_ID, BuilderMessages.TagValidator_private_enum_method);
} else if (Flags.isPackageDefault(mods)) {
  createTagProblem(item.typename, tag, IElementDescriptor.METHOD, IApiProblem.UNSUPPORTED_TAG_USE, IApiMarkerConstants.UNSUPPORTED_TAG_MARKER_ID, BuilderMessages.TagValidator_a_package_default_enum);
} else if (!item.visible) {
} else if (Flags.isPrivate(mods)) {
  createTagProblem(item.typename, tag, IElementDescriptor.METHOD, IApiProblem.UNSUPPORTED_TAG_USE, IApiMarkerConstants.UNSUPPORTED_TAG_MARKER_ID, isconstructor ? BuilderMessages.TagValidator_private_constructor : BuilderMessages.TagValidator_private_method);
} else if (Flags.isPackageDefault(mods)) {
  if (isstatic) {
    createTagProblem(item.typename, tag, IElementDescriptor.METHOD, IApiProblem.UNSUPPORTED_TAG_USE, IApiMarkerConstants.UNSUPPORTED_TAG_MARKER_ID, isconstructor ? BuilderMessages.TagValidator_static_package_constructor : BuilderMessages.TagValidator_a_static_package_default_method);

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

private void addOverlaysFromFlags(int flags, IDecoration decoration) {
  ImageDescriptor type;
  if (Flags.isAnnotation(flags)) {
    type= JavaPluginImages.DESC_OVR_ANNOTATION;
  } else if (Flags.isEnum(flags)) {
    type= JavaPluginImages.DESC_OVR_ENUM;
  } else if (Flags.isInterface(flags)) {
    type= JavaPluginImages.DESC_OVR_INTERFACE;
  } else if (/* is class */ Flags.isAbstract(flags)) {
    type= JavaPluginImages.DESC_OVR_ABSTRACT_CLASS;
  } else {
    type= null;
  }
  
  boolean deprecated= Flags.isDeprecated(flags);
  boolean packageDefault= Flags.isPackageDefault(flags);
  
  /* Each decoration position can only be used once. Since we don't want to take all positions
   * away from other decorators, we confine ourselves to only use the top right position. */
  
  if (type != null && !deprecated && !packageDefault) {
    decoration.addOverlay(type, IDecoration.TOP_RIGHT);
    
  } else if (type == null && deprecated && !packageDefault) {
    decoration.addOverlay(JavaPluginImages.DESC_OVR_DEPRECATED, IDecoration.TOP_RIGHT);
    
  } else if (type != null || deprecated || packageDefault) {
    decoration.addOverlay(new TypeIndicatorOverlay(type, deprecated, packageDefault), IDecoration.TOP_RIGHT);
  }
}

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

private void addOverlaysFromFlags(int flags, IDecoration decoration) {
  ImageDescriptor type;
  if (Flags.isAnnotation(flags)) {
    type= JavaPluginImages.DESC_OVR_ANNOTATION;
  } else if (Flags.isEnum(flags)) {
    type= JavaPluginImages.DESC_OVR_ENUM;
  } else if (Flags.isInterface(flags)) {
    type= JavaPluginImages.DESC_OVR_INTERFACE;
  } else if (/* is class */ Flags.isAbstract(flags)) {
    type= JavaPluginImages.DESC_OVR_ABSTRACT_CLASS;
  } else {
    type= null;
  }
  
  boolean deprecated= Flags.isDeprecated(flags);
  boolean packageDefault= Flags.isPackageDefault(flags);
  
  /* Each decoration position can only be used once. Since we don't want to take all positions
   * away from other decorators, we confine ourselves to only use the top right position. */
  
  if (type != null && !deprecated && !packageDefault) {
    decoration.addOverlay(type, IDecoration.TOP_RIGHT);
    
  } else if (type == null && deprecated && !packageDefault) {
    decoration.addOverlay(JavaPluginImages.DESC_OVR_DEPRECATED, IDecoration.TOP_RIGHT);
    
  } else if (type != null || deprecated || packageDefault) {
    decoration.addOverlay(new TypeIndicatorOverlay(type, deprecated, packageDefault), IDecoration.TOP_RIGHT);
  }
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools

} else if (Flags.isPrivate(flags)) {
  createAnnotationProblem(item.typename, node, IElementDescriptor.METHOD, IApiProblem.UNSUPPORTED_ANNOTATION_USE, IApiMarkerConstants.UNSUPPORTED_ANNOTATION_MARKER_ID, BuilderMessages.TagValidator_private_enum_method);
} else if (Flags.isPackageDefault(flags)) {
  createAnnotationProblem(item.typename, node, IElementDescriptor.METHOD, IApiProblem.UNSUPPORTED_ANNOTATION_USE, IApiMarkerConstants.UNSUPPORTED_ANNOTATION_MARKER_ID, BuilderMessages.TagValidator_a_package_default_enum);
} else if (!item.visible) {
} else if (Flags.isPrivate(flags)) {
  createAnnotationProblem(item.typename, node, IElementDescriptor.METHOD, IApiProblem.UNSUPPORTED_ANNOTATION_USE, IApiMarkerConstants.UNSUPPORTED_ANNOTATION_MARKER_ID, isconstructor ? BuilderMessages.TagValidator_private_constructor : BuilderMessages.TagValidator_private_method);
} else if (Flags.isPackageDefault(flags)) {
  if (isstatic) {
    createAnnotationProblem(item.typename, node, IElementDescriptor.METHOD, IApiProblem.UNSUPPORTED_ANNOTATION_USE, IApiMarkerConstants.UNSUPPORTED_ANNOTATION_MARKER_ID, isconstructor ? BuilderMessages.TagValidator_static_package_constructor : BuilderMessages.TagValidator_a_static_package_default_method);

代码示例来源:origin: org.eclipse.pde.api.tools/ui

int flags = method.getFlags();
if(Flags.isPrivate(flags) || 
    Flags.isPackageDefault(flags) || 
    hasNonVisibleParent(element, method.getDeclaringType().isInterface())) {
  return Collections.EMPTY_LIST;
    field.isEnumConstant() || 
    Flags.isPrivate(flags) || 
    Flags.isPackageDefault(flags) || 
    hasNonVisibleParent(element, field.getDeclaringType().isInterface())) {
  return Collections.EMPTY_LIST;

相关文章