本文整理汇总了Java中com.intellij.psi.util.MethodSignature.getTypeParameters方法的典型用法代码示例。如果您正苦于以下问题:Java MethodSignature.getTypeParameters方法的具体用法?Java MethodSignature.getTypeParameters怎么用?Java MethodSignature.getTypeParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.util.MethodSignature
的用法示例。
在下文中一共展示了MethodSignature.getTypeParameters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitClass
import com.intellij.psi.util.MethodSignature; //导入方法依赖的package包/类
@Override
public void visitClass(PsiClass aClass) {
super.visitClass(aClass);
if (!aClass.isInterface() || AnnotationUtil.isAnnotated(aClass, "java.lang.FunctionalInterface", false)) {
return;
}
if (LambdaHighlightingUtil.checkInterfaceFunctional(aClass) != null) {
return;
}
final List<HierarchicalMethodSignature> candidates = LambdaUtil.findFunctionCandidates(aClass);
if (candidates == null || candidates.size() != 1) {
return;
}
final MethodSignature signature = candidates.get(0);
if (signature.getTypeParameters().length > 0) {
return;
}
registerClassError(aClass, aClass);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:InterfaceMayBeAnnotatedFunctionalInspection.java
示例2: checkInterfaceFunctional
import com.intellij.psi.util.MethodSignature; //导入方法依赖的package包/类
@Nullable
public static String checkInterfaceFunctional(@NotNull PsiClass psiClass, String interfaceNonFunctionalMessage) {
if (psiClass instanceof PsiTypeParameter) return null; //should be logged as cyclic inference
final List<MethodSignature> signatures = LambdaUtil.findFunctionCandidates(psiClass);
if (signatures == null) return interfaceNonFunctionalMessage;
if (signatures.isEmpty()) return "No target method found";
if (signatures.size() == 1) {
final MethodSignature functionalMethod = signatures.get(0);
if (functionalMethod.getTypeParameters().length > 0) return "Target method is generic";
return null;
}
return "Multiple non-overriding abstract methods found";
}