A closure parameter hint class that is convenient if you want to use a String representation of the signature. It makes use of the option strings, where each string corresponds to a single signature.
The following example describes a closure as accepting a single signature (List<T> list ->):
public <T> T apply(T src, @ClosureParams(value=FromString.class, options="List<T>" Closure<T> cl)
The next example describes a closure as accepting two signatures (List<T> list ->) and (T t ->):
public <T> T apply(T src, @ClosureParams(value=FromString.class, options={"List<T>","T"} Closure<T> cl)
It is advisable not to use this hint as a replacement for the various FirstParam, SimpleType, ... hints because it is actually much slower. Using this hint should therefore be limited to cases where it's not possible to express the signature using the existing hints.
Type | Name and description |
---|---|
List<ClassNode> |
getClosureSignatures(MethodNode node, SourceUnit sourceUnit, CompilationUnit compilationUnit, String[] options, ASTNode usage) |
Methods inherited from class | Name |
---|---|
class ClosureSignatureHint |
findClassNode, getClosureSignatures, pickGenericType, pickGenericType |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |