Interface ExprMirror.LambdaExprMirror
-
- All Superinterfaces:
ExprMirror
,ExprMirror.FunctionalExprMirror
,ExprMirror.PolyExprMirror
- Enclosing interface:
- ExprMirror
public static interface ExprMirror.LambdaExprMirror extends ExprMirror.FunctionalExprMirror
Mirrors a lambda expression.
-
-
Nested Class Summary
-
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 @Nullable List<JTypeMirror>
getExplicitParameterTypes()
Returns the types of the explicit parameters.int
getParamCount()
Return the number of parameters of the lambda, regardless of whether it's explicitly typed or not.Iterable<ExprMirror>
getResultExpressions()
Returns all the expressions that appear inreturn
statements within the lambda.default boolean
isExplicitlyTyped()
boolean
isValueCompatible()
Returns true if the body is value-compatible (JLS§15.27.2).boolean
isVoidCompatible()
Returns true if the body is void-compatible (JLS§15.27.2).void
updateTypingContext(JMethodSig groundFun)
-
Methods inherited from interface net.sourceforge.pmd.lang.java.types.internal.infer.ExprMirror
finishStandaloneInference, getInferredType, getLocation, getStandaloneSpecies, getTypingContext, isEquivalentToUnderlyingAst
-
Methods inherited from interface net.sourceforge.pmd.lang.java.types.internal.infer.ExprMirror.FunctionalExprMirror
setFunctionalMethod, setInferredType
-
Methods inherited from interface net.sourceforge.pmd.lang.java.types.internal.infer.ExprMirror.PolyExprMirror
getEnclosingType, getStandaloneType, unresolvedType
-
-
-
-
Method Detail
-
getExplicitParameterTypes
@Nullable List<JTypeMirror> getExplicitParameterTypes()
Returns the types of the explicit parameters. If the lambda is implicitly typed, then returns null.Note that a degenerate case of explicitly typed lambda expression is a lambda with zero formal parameters.
-
isExplicitlyTyped
default boolean isExplicitlyTyped()
-
getParamCount
int getParamCount()
Return the number of parameters of the lambda, regardless of whether it's explicitly typed or not.
-
getResultExpressions
Iterable<ExprMirror> getResultExpressions()
Returns all the expressions that appear inreturn
statements within the lambda. If this is an expression-bodied lambda, returns the expression.
-
isValueCompatible
boolean isValueCompatible()
Returns true if the body is value-compatible (JLS§15.27.2).A block lambda body is value-compatible if it cannot complete normally (§14.21) and every return statement in the block has the form return Expression;.
-
isVoidCompatible
boolean isVoidCompatible()
Returns true if the body is void-compatible (JLS§15.27.2).A block lambda body is void-compatible if every return statement in the block has the form return;.
-
updateTypingContext
void updateTypingContext(JMethodSig groundFun)
-
-