Class TypeInference
java.lang.Object
com.github.javaparser.symbolsolver.resolution.typeinference.TypeInference
The API exposed by the TypeInference subsystem.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
appearInThrowsClause
(ResolvedTypeParameterDeclaration p, ResolvedMethodDeclaration methodDeclaration) private BoundSet
boundSetup
(List<ResolvedTypeParameterDeclaration> typeParameterDeclarations, List<InferenceVariable> inferenceVariables) When inference begins, a bound set is typically generated from a list of type parameter declarations P1, ..., Pp and associated inference variables α1, ..., αpprivate ConstraintFormulaSet
constraintSetFromArgumentsSubstitution
(List<ResolvedType> Fs, List<Expression> es, Substitution theta, int k) private List
<ResolvedType> formalParameterTypes
(ResolvedMethodDeclaration methodDeclaration) void
functionalInterfaceParameterizationInference
(LambdaExpr lambdaExpr, ResolvedInterfaceDeclaration interfaceDeclaration) instantiationInference
(MethodCallExpr methodCallExpr, ResolvedMethodDeclaration methodDeclaration) instantiationInference
(List<Expression> argumentExpressions, ResolvedMethodDeclaration methodDeclaration) private static MethodUsage
instantiationSetToMethodUsage
(ResolvedMethodDeclaration methodDeclaration, InstantiationSet instantiationSet) boolean
invocationApplicabilityInference
(MethodCallExpr methodCallExpr, ResolvedMethodDeclaration methodDeclaration) Determine whether a potentially applicable generic method m is applicable for a method invocation that provides no explicit type arguments.void
private boolean
isImplicitlyTyped
(LambdaExpr lambdaExpr) private boolean
isInexact
(MethodReferenceExpr methodReferenceExpr) private boolean
isPertinentToApplicability
(Expression argument) boolean
moreSpecificMethodInference
(MethodCallExpr methodCall, ResolvedMethodDeclaration m1, ResolvedMethodDeclaration m2) Return if m2 is more specific than m1private Optional
<ConstraintFormulaSet> testForApplicabilityByLooseInvocation
(List<ResolvedType> Fs, List<Expression> es, Substitution theta) private Optional
<ConstraintFormulaSet> testForApplicabilityByStrictInvocation
(List<ResolvedType> Fs, List<Expression> es, Substitution theta) private Optional
<ConstraintFormulaSet> testForApplicabilityByVariableArityInvocation
(List<ResolvedType> Fs, List<Expression> es, Substitution theta) static MethodUsage
toMethodUsage
(MethodCallExpr call, ResolvedMethodDeclaration methodDeclaration, TypeSolver typeSolver) private ResolvedType
typeWithSubstitution
(ResolvedType originalType, Substitution substitution)
-
Field Details
-
object
-
typeSolver
-
-
Constructor Details
-
TypeInference
-
-
Method Details
-
toMethodUsage
public static MethodUsage toMethodUsage(MethodCallExpr call, ResolvedMethodDeclaration methodDeclaration, TypeSolver typeSolver) -
instantiationInference
public Optional<InstantiationSet> instantiationInference(MethodCallExpr methodCallExpr, ResolvedMethodDeclaration methodDeclaration) -
instantiationInference
public Optional<InstantiationSet> instantiationInference(List<Expression> argumentExpressions, ResolvedMethodDeclaration methodDeclaration) -
invocationApplicabilityInference
public boolean invocationApplicabilityInference(MethodCallExpr methodCallExpr, ResolvedMethodDeclaration methodDeclaration) Determine whether a potentially applicable generic method m is applicable for a method invocation that provides no explicit type arguments. -
invocationTypeInferenceBoundsSetB3
-
invocationTypeInference
public void invocationTypeInference() -
functionalInterfaceParameterizationInference
public void functionalInterfaceParameterizationInference(LambdaExpr lambdaExpr, ResolvedInterfaceDeclaration interfaceDeclaration) -
moreSpecificMethodInference
public boolean moreSpecificMethodInference(MethodCallExpr methodCall, ResolvedMethodDeclaration m1, ResolvedMethodDeclaration m2) Return if m2 is more specific than m1- Parameters:
methodCall
-m1
-m2
-
-
instantiationSetToMethodUsage
private static MethodUsage instantiationSetToMethodUsage(ResolvedMethodDeclaration methodDeclaration, InstantiationSet instantiationSet) -
boundSetup
private BoundSet boundSetup(List<ResolvedTypeParameterDeclaration> typeParameterDeclarations, List<InferenceVariable> inferenceVariables) When inference begins, a bound set is typically generated from a list of type parameter declarations P1, ..., Pp and associated inference variables α1, ..., αp- Parameters:
typeParameterDeclarations
-inferenceVariables
-- Returns:
-
appearInThrowsClause
private boolean appearInThrowsClause(ResolvedTypeParameterDeclaration p, ResolvedMethodDeclaration methodDeclaration) -
formalParameterTypes
-
isImplicitlyTyped
-
isInexact
-
isPertinentToApplicability
-
testForApplicabilityByStrictInvocation
private Optional<ConstraintFormulaSet> testForApplicabilityByStrictInvocation(List<ResolvedType> Fs, List<Expression> es, Substitution theta) -
typeWithSubstitution
-
testForApplicabilityByLooseInvocation
private Optional<ConstraintFormulaSet> testForApplicabilityByLooseInvocation(List<ResolvedType> Fs, List<Expression> es, Substitution theta) -
constraintSetFromArgumentsSubstitution
private ConstraintFormulaSet constraintSetFromArgumentsSubstitution(List<ResolvedType> Fs, List<Expression> es, Substitution theta, int k) -
testForApplicabilityByVariableArityInvocation
private Optional<ConstraintFormulaSet> testForApplicabilityByVariableArityInvocation(List<ResolvedType> Fs, List<Expression> es, Substitution theta)
-