public class PsiResolveHelperImpl extends java.lang.Object implements PsiResolveHelper
PsiResolveHelper.SERVICE
ourGraphGuard, ourGuard
Constructor and Description |
---|
PsiResolveHelperImpl(Project project) |
PsiResolveHelperImpl(PsiManager manager)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
LanguageLevel |
getEffectiveLanguageLevel(VirtualFile virtualFile) |
PsiInferenceHelper |
getInferenceHelper(LanguageLevel languageLevel) |
CandidateInfo [] |
getReferencedMethodCandidates(PsiCallExpression call,
boolean dummyImplicitConstructor)
Resolves a call expression and returns an array of possible resolve results.
|
CandidateInfo [] |
getReferencedMethodCandidates(PsiCallExpression expr,
boolean dummyImplicitConstructor,
boolean checkVarargs)
Resolves a call expression and returns an array of possible resolve results.
|
PsiType |
getSubstitutionForTypeParameter(PsiTypeParameter typeParam,
PsiType param,
PsiType arg,
boolean isContraVariantPosition,
LanguageLevel languageLevel) |
boolean |
hasOverloads(PsiCallExpression call)
Checks if there are method (or constructor) overloads.
|
PsiSubstitutor |
inferTypeArguments(PsiTypeParameter [] typeParameters,
PsiParameter [] parameters,
PsiExpression [] arguments,
MethodCandidateInfo currentCandidate,
PsiElement parent,
ParameterTypeInferencePolicy policy,
LanguageLevel languageLevel) |
PsiSubstitutor |
inferTypeArguments(PsiTypeParameter [] typeParameters,
PsiParameter [] parameters,
PsiExpression [] arguments,
PsiSubstitutor partialSubstitutor,
PsiElement parent,
ParameterTypeInferencePolicy policy) |
PsiSubstitutor |
inferTypeArguments(PsiTypeParameter [] typeParameters,
PsiType [] leftTypes,
PsiType [] rightTypes,
LanguageLevel languageLevel) |
PsiSubstitutor |
inferTypeArguments(PsiTypeParameter [] typeParameters,
PsiType [] leftTypes,
PsiType [] rightTypes,
PsiSubstitutor partialSubstitutor,
LanguageLevel languageLevel) |
PsiType |
inferTypeForMethodTypeParameter(PsiTypeParameter typeParameter,
PsiParameter [] parameters,
PsiExpression [] arguments,
PsiSubstitutor partialSubstitutor,
PsiElement parent,
ParameterTypeInferencePolicy policy)
Returns
PsiType.NULL iff no type could be inferred, null iff the type inferred is raw, the inferred type otherwise. |
boolean |
isAccessible(PsiMember member,
PsiElement place,
PsiClass accessObjectClass)
Returns
true if a member is accessible from a given place according to JLS 6.6 "Access Control". |
boolean |
isAccessible(PsiMember member,
PsiModifierList modifierList,
PsiElement place,
PsiClass accessObjectClass,
PsiElement currentFileResolveScope)
Returns
true if a member is accessible from a given place according to JLS 6.6 "Access Control". |
boolean |
isAccessible(PsiPackage pkg,
PsiElement place)
Returns
true if a package is accessible from a given place according to JLS 6.6 "Access Control". |
JavaResolveResult [] |
multiResolveConstructor(PsiClassType type,
PsiExpressionList argumentList,
PsiElement place)
Resolves a constructor and returns all variants for the resolve.
|
PsiVariable |
resolveAccessibleReferencedVariable(java.lang.String referenceText,
PsiElement context)
Resolves a reference to a variable, given the text of the reference and the context
in which it was encountered.
|
JavaResolveResult |
resolveConstructor(PsiClassType classType,
PsiExpressionList argumentList,
PsiElement place)
Resolves a constructor.
|
PsiClass |
resolveReferencedClass(java.lang.String referenceText,
PsiElement context)
Resolves a reference to a class, given the text of the reference and the context
in which it was encountered.
|
PsiVariable |
resolveReferencedVariable(java.lang.String referenceText,
PsiElement context)
Resolves a reference to a variable, given the text of the reference and the context
in which it was encountered.
|
public PsiResolveHelperImpl(Project project)
@Deprecated public PsiResolveHelperImpl(PsiManager manager)
PsiResolveHelperImpl(Project)
public JavaResolveResult resolveConstructor(PsiClassType classType, PsiExpressionList argumentList, PsiElement place)
PsiResolveHelper
resolveConstructor
in interface PsiResolveHelper
classType
- the class containing the constructorargumentList
- list of arguments of the call or new expressionplace
- place where constructor is invoked (used for checking access)JavaResolveResult.EMPTY
if the resolve failed.public JavaResolveResult [] multiResolveConstructor(PsiClassType type, PsiExpressionList argumentList, PsiElement place)
PsiResolveHelper
multiResolveConstructor
in interface PsiResolveHelper
type
- the class containing the constructorargumentList
- list of arguments of the call or new expressionplace
- place where constructor is invoked (used for checking access)JavaResolveResult.EMPTY
if the resolve failed.public PsiClass resolveReferencedClass(java.lang.String referenceText, PsiElement context)
PsiResolveHelper
resolveReferencedClass
in interface PsiResolveHelper
referenceText
- the text of the reference.context
- the context in which the reference is found.public PsiVariable resolveReferencedVariable(java.lang.String referenceText, PsiElement context)
PsiResolveHelper
resolveReferencedVariable
in interface PsiResolveHelper
referenceText
- the text of the reference.context
- the context in which the reference is found.public PsiVariable resolveAccessibleReferencedVariable(java.lang.String referenceText, PsiElement context)
PsiResolveHelper
resolveAccessibleReferencedVariable
in interface PsiResolveHelper
referenceText
- the text of the reference.context
- the context in which the reference is found.public boolean isAccessible(PsiMember member, PsiElement place, PsiClass accessObjectClass)
PsiResolveHelper
true
if a member is accessible from a given place according to JLS 6.6 "Access Control".isAccessible
in interface PsiResolveHelper
public boolean isAccessible(PsiMember member, PsiModifierList modifierList, PsiElement place, PsiClass accessObjectClass, PsiElement currentFileResolveScope)
PsiResolveHelper
true
if a member is accessible from a given place according to JLS 6.6 "Access Control".isAccessible
in interface PsiResolveHelper
public boolean isAccessible(PsiPackage pkg, PsiElement place)
PsiResolveHelper
true
if a package is accessible from a given place according to JLS 6.6 "Access Control".isAccessible
in interface PsiResolveHelper
public CandidateInfo [] getReferencedMethodCandidates(PsiCallExpression expr, boolean dummyImplicitConstructor, boolean checkVarargs)
PsiResolveHelper
getReferencedMethodCandidates
in interface PsiResolveHelper
expr
- the call expression to resolve.dummyImplicitConstructor
- if true, implicit empty constructor which does not actually exist
can be returned as a candidate for the resolve.checkVarargs
- true if varargs method should lead to 2 candidates in the result arraypublic boolean hasOverloads(PsiCallExpression call)
PsiResolveHelper
hasOverloads
in interface PsiResolveHelper
public CandidateInfo [] getReferencedMethodCandidates(PsiCallExpression call, boolean dummyImplicitConstructor)
PsiResolveHelper
getReferencedMethodCandidates
in interface PsiResolveHelper
call
- the call expression to resolve.dummyImplicitConstructor
- if true, implicit empty constructor which does not actually exist
can be returned as a candidate for the resolve.public PsiType inferTypeForMethodTypeParameter(PsiTypeParameter typeParameter, PsiParameter [] parameters, PsiExpression [] arguments, PsiSubstitutor partialSubstitutor, PsiElement parent, ParameterTypeInferencePolicy policy)
PsiResolveHelper
PsiType.NULL
iff no type could be inferred, null
iff the type inferred is raw, the inferred type otherwise.inferTypeForMethodTypeParameter
in interface PsiResolveHelper
public PsiSubstitutor inferTypeArguments(PsiTypeParameter [] typeParameters, PsiParameter [] parameters, PsiExpression [] arguments, PsiSubstitutor partialSubstitutor, PsiElement parent, ParameterTypeInferencePolicy policy)
inferTypeArguments
in interface PsiResolveHelper
public PsiSubstitutor inferTypeArguments(PsiTypeParameter [] typeParameters, PsiParameter [] parameters, PsiExpression [] arguments, MethodCandidateInfo currentCandidate, PsiElement parent, ParameterTypeInferencePolicy policy, LanguageLevel languageLevel)
inferTypeArguments
in interface PsiResolveHelper
public PsiSubstitutor inferTypeArguments(PsiTypeParameter [] typeParameters, PsiType [] leftTypes, PsiType [] rightTypes, LanguageLevel languageLevel)
inferTypeArguments
in interface PsiResolveHelper
public PsiSubstitutor inferTypeArguments(PsiTypeParameter [] typeParameters, PsiType [] leftTypes, PsiType [] rightTypes, PsiSubstitutor partialSubstitutor, LanguageLevel languageLevel)
inferTypeArguments
in interface PsiResolveHelper
public PsiType getSubstitutionForTypeParameter(PsiTypeParameter typeParam, PsiType param, PsiType arg, boolean isContraVariantPosition, LanguageLevel languageLevel)
getSubstitutionForTypeParameter
in interface PsiResolveHelper
public LanguageLevel getEffectiveLanguageLevel(VirtualFile virtualFile)
getEffectiveLanguageLevel
in interface PsiResolveHelper
public PsiInferenceHelper getInferenceHelper(LanguageLevel languageLevel)