本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}