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


Java PsiUtil.getMemberQualifiedName方法代码示例

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


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

示例1: getAccessedVariableOrGetter

import com.intellij.psi.util.PsiUtil; //导入方法依赖的package包/类
@Nullable
private static PsiModifierListOwner getAccessedVariableOrGetter(final PsiElement target) {
  if (target instanceof PsiVariable) {
    return (PsiVariable)target;
  }
  if (target instanceof PsiMethod) {
    PsiMethod method = (PsiMethod)target;
    if (PropertyUtil.isSimplePropertyGetter(method) && !(method.getReturnType() instanceof PsiPrimitiveType)) {
      String qName = PsiUtil.getMemberQualifiedName(method);
      if (qName == null || !FALSE_GETTERS.value(qName)) {
        return method;
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:DfaExpressionFactory.java

示例2: compareMembers

import com.intellij.psi.util.PsiUtil; //导入方法依赖的package包/类
private static int compareMembers(PsiMember m1, PsiMember m2, PsiExpression context) {
  ProgressManager.checkCanceled();
  int result = JavaStatisticsManager.createInfo(null, m2).getUseCount() - JavaStatisticsManager.createInfo(null, m1).getUseCount();
  if (result != 0) return result;
  final PsiClass aClass = m1.getContainingClass();
  final PsiClass bClass = m2.getContainingClass();
  if (aClass != null && bClass != null) {
    result = JavaStatisticsManager.createInfo(null, bClass).getUseCount() - JavaStatisticsManager.createInfo(null, aClass).getUseCount();
    if (result != 0) return result;
  }

  WeighingComparable<PsiElement,ProximityLocation> proximity1 = PsiProximityComparator.getProximity(m1, context);
  WeighingComparable<PsiElement,ProximityLocation> proximity2 = PsiProximityComparator.getProximity(m2, context);
  if (proximity1 != null && proximity2 != null) {
    result = proximity2.compareTo(proximity1);
    if (result != 0) return result;
  }

  String name1 = PsiUtil.getMemberQualifiedName(m1);
  String name2 = PsiUtil.getMemberQualifiedName(m2);
  return Comparing.compare(name1, name2);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:CreateFromUsageUtils.java

示例3: getQualifiedNameMatcher

import com.intellij.psi.util.PsiUtil; //导入方法依赖的package包/类
private static Condition<PsiMember> getQualifiedNameMatcher(String completePattern) {
  final Condition<PsiMember> qualifiedMatcher;
  if (completePattern.contains(".")) {
    final MinusculeMatcher matcher = new MinusculeMatcher("*" + StringUtil.replace(completePattern, ".", ".*"), NameUtil.MatchingCaseSensitivity.NONE);
    qualifiedMatcher = new Condition<PsiMember>() {
      @Override
      public boolean value(PsiMember member) {
        String qualifiedName = PsiUtil.getMemberQualifiedName(member);
        return qualifiedName != null && matcher.matches(qualifiedName);
      }
    };
  } else {
    //noinspection unchecked
    qualifiedMatcher = Condition.TRUE;
  }
  return qualifiedMatcher;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:DefaultSymbolNavigationContributor.java

示例4: isHardcodedPure

import com.intellij.psi.util.PsiUtil; //导入方法依赖的package包/类
public static boolean isHardcodedPure(PsiMethod method) {
  String qName = PsiUtil.getMemberQualifiedName(method);
  if ("java.lang.System.exit".equals(qName)) {
    return false;
  }

  if ("java.util.Objects.requireNonNull".equals(qName)) {
    PsiParameter[] parameters = method.getParameterList().getParameters();
    if (parameters.length == 2 && parameters[1].getType().getCanonicalText().contains("Supplier")) {
      return false;
    }
  }

  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:HardcodedContracts.java

示例5: isInExcludedPackage

import com.intellij.psi.util.PsiUtil; //导入方法依赖的package包/类
public static boolean isInExcludedPackage(@NotNull final PsiMember member, boolean allowInstanceInnerClasses) {
  final String name = PsiUtil.getMemberQualifiedName(member);
  if (name == null) return false;

  if (!member.hasModifierProperty(PsiModifier.STATIC)) {
    if (member instanceof PsiMethod || member instanceof PsiField) {
      return false;
    }
    if (allowInstanceInnerClasses && member instanceof PsiClass && member.getContainingClass() != null) {
      return false;
    }
  }

  return JavaProjectCodeInsightSettings.getSettings(member.getProject()).isExcluded(name);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:JavaCompletionUtil.java


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