public class PsiTypesUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PsiTypesUtil.TypeParameterSearcher |
Modifier and Type | Method and Description |
---|---|
static boolean |
allTypeParametersResolved(PsiElement context,
PsiType targetType) |
static java.lang.String |
boxIfPossible(java.lang.String type)
Returns the boxed type name or parameter.
|
static boolean |
compareTypes(PsiType leftType,
PsiType rightType,
boolean ignoreEllipsis) |
static PsiType |
createArrayType(PsiType newType,
int arrayDim) |
static PsiType |
createJavaLangClassType(PsiElement context,
PsiType qualifierType,
boolean captureTopLevelWildcards) |
static PsiTypeParameter [] |
filterUnusedTypeParameters(PsiTypeParameter [] typeParameters,
PsiType... types) |
static PsiTypeParameter [] |
filterUnusedTypeParameters(PsiType superReturnTypeInBaseClassType,
PsiTypeParameter [] typeParameters) |
static PsiClassType |
getClassType(PsiClass psiClass) |
static java.lang.Object |
getDefaultValue(PsiType type) |
static java.lang.String |
getDefaultValueOfType(PsiType type) |
static java.lang.String |
getDefaultValueOfType(PsiType type,
boolean customDefaultValues) |
static PsiType |
getExpectedTypeByParent(PsiElement element)
Return type explicitly declared in parent
|
static PsiClassType |
getLowestUpperBoundClassType(PsiDisjunctionType type) |
static PsiType |
getMethodReturnType(PsiElement element)
Returns the return type for enclosing method or lambda
|
static PsiType |
getParameterType(PsiParameter [] parameters,
int i,
boolean varargs) |
static PsiClass |
getPsiClass(PsiType psiType) |
static PsiType |
getTypeByMethod(PsiElement context,
PsiExpressionList argumentList,
PsiElement parentMethod,
boolean varargs,
PsiSubstitutor substitutor,
boolean inferParent) |
static boolean |
hasUnresolvedComponents(PsiType type) |
static boolean |
isDenotableType(PsiType type)
Deprecated.
not compliant to specification, use
isDenotableType(PsiType, PsiElement) instead |
static boolean |
isDenotableType(PsiType type,
PsiElement context) |
static boolean |
isGetClass(PsiMethod method) |
static boolean |
isUncheckedCall(JavaResolveResult resolveResult)
Checks if
resolveResult depicts unchecked method call |
static boolean |
mentionsTypeParameters(PsiType type,
java.util.Set<PsiTypeParameter> typeParameters)
Checks if
type mentions type parameters from the passed Set
Implicit type arguments of types based on inner classes of generic outer classes are explicitly checked |
static PsiType |
patchMethodGetClassReturnType(PsiExpression call,
PsiReferenceExpression methodExpression,
PsiMethod method,
Condition<? super IElementType> condition,
LanguageLevel languageLevel) |
static PsiType |
patchMethodGetClassReturnType(PsiMethodReferenceExpression methodExpression,
PsiMethod method) |
static PsiTypeElement |
replaceWithExplicitType(PsiTypeElement typeElement) |
static java.lang.String |
unboxIfPossible(java.lang.String type)
Returns the unboxed type name or parameter.
|
public static java.lang.Object getDefaultValue(PsiType type)
public static java.lang.String getDefaultValueOfType(PsiType type)
public static java.lang.String getDefaultValueOfType(PsiType type, boolean customDefaultValues)
public static java.lang.String unboxIfPossible(java.lang.String type)
type
- boxed java type namepublic static java.lang.String boxIfPossible(java.lang.String type)
type
- primitive java type namepublic static PsiClassType getClassType(PsiClass psiClass)
public static PsiClassType getLowestUpperBoundClassType(PsiDisjunctionType type)
public static PsiType patchMethodGetClassReturnType(PsiMethodReferenceExpression methodExpression, PsiMethod method)
public static PsiType patchMethodGetClassReturnType(PsiExpression call, PsiReferenceExpression methodExpression, PsiMethod method, Condition<? super IElementType> condition, LanguageLevel languageLevel)
public static boolean isGetClass(PsiMethod method)
public static PsiType createJavaLangClassType(PsiElement context, PsiType qualifierType, boolean captureTopLevelWildcards)
public static PsiType getExpectedTypeByParent(PsiElement element)
public static PsiType getMethodReturnType(PsiElement element)
element
- element inside method or lambda to determine the return type ofpublic static boolean compareTypes(PsiType leftType, PsiType rightType, boolean ignoreEllipsis)
@Deprecated public static boolean isDenotableType(PsiType type)
isDenotableType(PsiType, PsiElement)
insteadpublic static boolean isDenotableType(PsiType type, PsiElement context)
context
- in which type should be checkedpublic static boolean hasUnresolvedComponents(PsiType type)
public static PsiType getParameterType(PsiParameter [] parameters, int i, boolean varargs)
public static PsiTypeParameter [] filterUnusedTypeParameters(PsiTypeParameter [] typeParameters, PsiType... types)
public static PsiTypeParameter [] filterUnusedTypeParameters(PsiType superReturnTypeInBaseClassType, PsiTypeParameter [] typeParameters)
public static boolean allTypeParametersResolved(PsiElement context, PsiType targetType)
public static PsiTypeElement replaceWithExplicitType(PsiTypeElement typeElement)
public static PsiType getTypeByMethod(PsiElement context, PsiExpressionList argumentList, PsiElement parentMethod, boolean varargs, PsiSubstitutor substitutor, boolean inferParent)
public static boolean mentionsTypeParameters(PsiType type, java.util.Set<PsiTypeParameter> typeParameters)
type
mentions type parameters from the passed Set
Implicit type arguments of types based on inner classes of generic outer classes are explicitly checkedpublic static boolean isUncheckedCall(JavaResolveResult resolveResult)
resolveResult
depicts unchecked method call