Interface ExprMirror.InvocationMirror
-
- All Superinterfaces:
ExprMirror
,ExprMirror.PolyExprMirror
- All Known Subinterfaces:
ExprMirror.CtorInvocationMirror
- Enclosing interface:
- ExprMirror
public static interface ExprMirror.InvocationMirror extends ExprMirror.PolyExprMirror
Adapter over a method or constructor invocation expression.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ExprMirror.InvocationMirror.MethodCtDecl
Information about the overload-resolution for a specific method.-
Nested classes/interfaces inherited from interface net.sourceforge.pmd.lang.java.types.internal.infer.ExprMirror
ExprMirror.BranchingMirror, ExprMirror.CtorInvocationMirror, ExprMirror.FunctionalExprMirror, ExprMirror.InvocationMirror, ExprMirror.LambdaExprMirror, ExprMirror.MethodRefMirror, ExprMirror.PolyExprMirror, ExprMirror.TypeSpecies
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Iterable<JMethodSig>
getAccessibleCandidates()
Enumerates *accessible* method (or ctor) signatures with *the same name* as this invocation.int
getArgumentCount()
List<ExprMirror>
getArgumentExpressions()
Returns the expressions corresponding to the arguments of the call.@Nullable ExprMirror.InvocationMirror.MethodCtDecl
getCtDecl()
Returns the method type set withsetCtDecl(MethodCtDecl)
or null if that method was never called.default @Nullable JTypeMirror
getErasedReceiverType()
Returns the erased receiver type.JavaNode
getExplicitTargLoc(int i)
List<JTypeMirror>
getExplicitTypeArguments()
Returns the explicit type arguments, eg inArrays.<String>asList("q")
, ornew <String> Foo("q")
.String
getName()
Returns the name of the invoked method.@Nullable JTypeMirror
getReceiverType()
Returns the erased receiver type.void
setCtDecl(ExprMirror.InvocationMirror.MethodCtDecl methodType)
-
Methods inherited from interface net.sourceforge.pmd.lang.java.types.internal.infer.ExprMirror
finishStandaloneInference, getInferredType, getLocation, getStandaloneSpecies, getTypingContext, isEquivalentToUnderlyingAst, setInferredType
-
Methods inherited from interface net.sourceforge.pmd.lang.java.types.internal.infer.ExprMirror.PolyExprMirror
getEnclosingType, getStandaloneType, unresolvedType
-
-
-
-
Method Detail
-
getAccessibleCandidates
Iterable<JMethodSig> getAccessibleCandidates()
Enumerates *accessible* method (or ctor) signatures with *the same name* as this invocation. Name and accessibility will not be checked later. The details on how to determine this are here: https://docs.oracle.com/javase/specs/jls/se9/html/jls-15.html#jls-15.12.1
-
getErasedReceiverType
default @Nullable JTypeMirror getErasedReceiverType()
Returns the erased receiver type. This is only used to adapt theObject::getClass
method, other types of invocations don't need to implement this.
-
getReceiverType
@Nullable JTypeMirror getReceiverType()
Returns the erased receiver type. This is only used for method invocations.
-
getExplicitTypeArguments
List<JTypeMirror> getExplicitTypeArguments()
Returns the explicit type arguments, eg inArrays.<String>asList("q")
, ornew <String> Foo("q")
. If none are mentioned, returns an empty list.
-
getExplicitTargLoc
JavaNode getExplicitTargLoc(int i)
- Throws:
IndexOutOfBoundsException
- If there's no explicit type argument at the given index
-
getName
String getName()
Returns the name of the invoked method. If this is a constructor call, returnsJConstructorSymbol.CTOR_NAME
.
-
getArgumentExpressions
List<ExprMirror> getArgumentExpressions()
Returns the expressions corresponding to the arguments of the call.
-
getArgumentCount
int getArgumentCount()
-
setCtDecl
void setCtDecl(ExprMirror.InvocationMirror.MethodCtDecl methodType)
-
getCtDecl
@Nullable ExprMirror.InvocationMirror.MethodCtDecl getCtDecl()
Returns the method type set withsetCtDecl(MethodCtDecl)
or null if that method was never called. This is used to perform overload resolution exactly once per call site.
-
-