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


Java IMember.equals方法代码示例

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


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

示例1: adjustMemberVisibility

import org.eclipse.jdt.core.IMember; //导入方法依赖的package包/类
/**
 * Check whether anyone accesses the members of the moved type from the outside. Those may need to
 * have their visibility adjusted.
 *
 * @param member the member
 * @param monitor the progress monitor to use
 * @throws JavaModelException if an error occurs
 */
private void adjustMemberVisibility(final IMember member, final IProgressMonitor monitor)
    throws JavaModelException {

  if (member instanceof IType) {
    // recursively check accessibility of member type's members
    final IJavaElement[] typeMembers = ((IType) member).getChildren();
    for (int i = 0; i < typeMembers.length; i++) {
      if (!(typeMembers[i] instanceof IInitializer))
        adjustMemberVisibility((IMember) typeMembers[i], monitor);
    }
  }

  if (member.equals(fReferenced) || Modifier.isPublic(member.getFlags())) return;

  final SearchResultGroup[] references = findReferences(member, monitor);
  for (int i = 0; i < references.length; i++) {
    final SearchMatch[] searchResults = references[i].getSearchResults();
    for (int k = 0; k < searchResults.length; k++) {
      final IJavaElement referenceToMember = (IJavaElement) searchResults[k].getElement();
      if (fAdjustments.get(member) == null
          && referenceToMember instanceof IMember
          && !isInsideMovedMember(referenceToMember)) {
        // check whether the member is still visible from the
        // destination. As we are moving a type, the destination is
        // a package or another type.
        adjustIncomingVisibility(fReferencing, member, new SubProgressMonitor(monitor, 1));
      }
    }
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:39,代码来源:MemberVisibilityAdjustor.java


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