当前位置: 首页>>代码示例>>Java>>正文


Java Flags.isSynthetic方法代码示例

本文整理汇总了Java中org.eclipse.jdt.core.Flags.isSynthetic方法的典型用法代码示例。如果您正苦于以下问题:Java Flags.isSynthetic方法的具体用法?Java Flags.isSynthetic怎么用?Java Flags.isSynthetic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.core.Flags的用法示例。


在下文中一共展示了Flags.isSynthetic方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isSyntheticElement

import org.eclipse.jdt.core.Flags; //导入方法依赖的package包/类
private boolean isSyntheticElement(IJavaElement element) {
	if (!(element instanceof IMember)) {
		return false;
	}
	IMember member= (IMember)element;
	if (!(member.isBinary())) {
		return false;
	}
	try {
		return Flags.isSynthetic(member.getFlags());
	} catch (JavaModelException e) {
		return false;
	}
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:15,代码来源:DocumentSymbolHandler.java

示例2: isSynthetic

import org.eclipse.jdt.core.Flags; //导入方法依赖的package包/类
public static boolean isSynthetic(IMember member) throws JavaModelException {
  return Flags.isSynthetic(member.getFlags());
}
 
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:JdtFlags.java

示例3: appendMembers

import org.eclipse.jdt.core.Flags; //导入方法依赖的package包/类
protected void appendMembers(final IType type, final IProgressMonitor monitor)
    throws JavaModelException {
  try {
    monitor.beginTask(RefactoringCoreMessages.StubCreationOperation_creating_type_stubs, 1);
    final IJavaElement[] children = type.getChildren();
    for (int index = 0; index < children.length; index++) {
      final IMember child = (IMember) children[index];
      final int flags = child.getFlags();
      final boolean isPrivate = Flags.isPrivate(flags);
      final boolean isDefault = !Flags.isPublic(flags) && !Flags.isProtected(flags) && !isPrivate;
      final boolean stub = fStubInvisible || (!isPrivate && !isDefault);
      if (child instanceof IType) {
        if (stub) appendTypeDeclaration((IType) child, new SubProgressMonitor(monitor, 1));
      } else if (child instanceof IField) {
        if (stub && !Flags.isEnum(flags) && !Flags.isSynthetic(flags))
          appendFieldDeclaration((IField) child);
      } else if (child instanceof IMethod) {
        final IMethod method = (IMethod) child;
        final String name = method.getElementName();
        if (method.getDeclaringType().isEnum()) {
          final int count = method.getNumberOfParameters();
          if (count == 0 && "values".equals(name)) // $NON-NLS-1$
          continue;
          if (count == 1
              && "valueOf".equals(name)
              && "Ljava.lang.String;"
                  .equals(method.getParameterTypes()[0])) // $NON-NLS-1$ //$NON-NLS-2$
          continue;
          if (method.isConstructor()) continue;
        }
        boolean skip = !stub || name.equals("<clinit>"); // $NON-NLS-1$
        if (method.isConstructor()) skip = false;
        skip = skip || Flags.isSynthetic(flags) || Flags.isBridge(flags);
        if (!skip) appendMethodDeclaration(method);
      }
      fBuffer.append("\n"); // $NON-NLS-1$
    }
  } finally {
    monitor.done();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:42,代码来源:StubCreator.java


注:本文中的org.eclipse.jdt.core.Flags.isSynthetic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。