Top Description Constructors Methods
groovy.transform.stc

public Class PickFirstResolver

extends ClosureSignatureConflictResolver
Class Inheritance
Imports
org.codehaus.groovy.ast.ClassNode, .MethodNode, org.codehaus.groovy.ast.expr.ClosureExpression, .Expression, org.codehaus.groovy.control.CompilationUnit, .SourceUnit, java.util.Collections, .List

Returns the first of several candidates found. This is useful if several types should be supported but only the first should be the default/inferred type. Other options in the list are obtained through explicitly typing the parameter(s).
Since
2.5.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public List<ClassNode[]>
resolve(List<ClassNode[]>
the list of signatures as determined after applying type hints and performing initial inference calculations
candidates
,
ClassNode
the receiver the method is being called on
receiver
,
Expression
the arguments for the closure
arguments
,
ClosureExpression
the closure expression under analysis
closure
,
MethodNode
the method for which a groovy.lang.Closure parameter was annotated with ClosureParams
methodNode
,
SourceUnit
the source unit of the file being compiled
sourceUnit
,
CompilationUnit
the compilation unit of the file being compiled
compilationUnit
,
String[]
the options, corresponding to the ClosureParams#options() found on the annotation
options
)

Overrides groovy.transform.stc.ClosureSignatureConflictResolver.resolve.

Constructor Detail

PickFirstResolverback to summary
public PickFirstResolver()

Method Detail

resolveback to summary
public List<ClassNode[]> resolve(List<ClassNode[]> candidates, ClassNode receiver, Expression arguments, ClosureExpression closure, MethodNode methodNode, SourceUnit sourceUnit, CompilationUnit compilationUnit, String[] options)

Overrides groovy.transform.stc.ClosureSignatureConflictResolver.resolve.

Parameters
candidates:List<ClassNode[]>

Doc from groovy.transform.stc.ClosureSignatureConflictResolver.resolve.

the list of signatures as determined after applying type hints and performing initial inference calculations

receiver:ClassNode

Doc from groovy.transform.stc.ClosureSignatureConflictResolver.resolve.

the receiver the method is being called on

arguments:Expression

Doc from groovy.transform.stc.ClosureSignatureConflictResolver.resolve.

the arguments for the closure

closure:ClosureExpression

Doc from groovy.transform.stc.ClosureSignatureConflictResolver.resolve.

the closure expression under analysis

methodNode:MethodNode

Doc from groovy.transform.stc.ClosureSignatureConflictResolver.resolve.

the method for which a groovy.lang.Closure parameter was annotated with ClosureParams

sourceUnit:SourceUnit

Doc from groovy.transform.stc.ClosureSignatureConflictResolver.resolve.

the source unit of the file being compiled

compilationUnit:CompilationUnit

Doc from groovy.transform.stc.ClosureSignatureConflictResolver.resolve.

the compilation unit of the file being compiled

options:String[]

Doc from groovy.transform.stc.ClosureSignatureConflictResolver.resolve.

the options, corresponding to the ClosureParams#options() found on the annotation

Returns:List<ClassNode[]>

Doc from groovy.transform.stc.ClosureSignatureConflictResolver.resolve.

a non-null list of signatures, where a signature corresponds to an array of class nodes, each of them matching a parameter. A list with more than one element indicates that all ambiguities haven't yet been resolved.

Annotations
@Override