Top Description Inners Constructors Methods
groovy.transform.stc

public Class FirstParam

extends PickAnyArgumentHint
Class Inheritance
Known Direct Subclasses
groovy.transform.stc.FirstParam.Component
Imports
org.codehaus.groovy.ast.ASTNode, .ClassNode, .MethodNode, org.codehaus.groovy.control.CompilationUnit, .SourceUnit

A hint used to instruct the type checker to pick the first parameter type. For example:

public <T> def doWith(T src, @ClosureParams(FirstParam.class) Closure c) { c.call(src); }

This class has several inner classes that also helps picking generic argument types instead of the parameter type.

Since
2.3.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
FirstParam.Component

A hint used to instruct the type checker to pick the type of the component of the first parameter type, which is therefore expected to be an array, like in this example: void <T> doWithArray(T[] array, @ClosureParams(FirstParam.Component.class) Closure c) { array.each { c.call(it)} }

public static class
FirstParam.FirstGenericType

A hint used to instruct the type checker to pick the first generic type of the first parameter type.

public static class
FirstParam.SecondGenericType

A hint used to instruct the type checker to pick the second generic type of the first parameter type.

public static class
FirstParam.ThirdGenericType

A hint used to instruct the type checker to pick the third generic type of the first parameter type.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from groovy.transform.stc.PickAnyArgumentHint:
getParameterTypes

Constructor Detail

FirstParamback to summary
public FirstParam()
groovy.transform.stc back to summary

public Class FirstParam.Component

extends FirstParam
Class Inheritance

A hint used to instruct the type checker to pick the type of the component of the first parameter type, which is therefore expected to be an array, like in this example:

void <T> doWithArray(T[] array, @ClosureParams(FirstParam.Component.class) Closure c) { array.each { c.call(it)} }

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ClassNode[]
getParameterTypes(final MethodNode node, final String[] options, final SourceUnit sourceUnit, final CompilationUnit unit, final ASTNode usage)

Overrides groovy.transform.stc.PickAnyArgumentHint.getParameterTypes.

Constructor Detail

Componentback to summary
public Component()

Method Detail

getParameterTypesback to summary
public ClassNode[] getParameterTypes(final MethodNode node, final String[] options, final SourceUnit sourceUnit, final CompilationUnit unit, final ASTNode usage)

Overrides groovy.transform.stc.PickAnyArgumentHint.getParameterTypes.

Annotations
@Override
groovy.transform.stc back to summary

public Class FirstParam.FirstGenericType

extends PickAnyArgumentHint
Class Inheritance

A hint used to instruct the type checker to pick the first generic type of the first parameter type. For example:

void <T> doWithElements(List<T> src, @ClosureParams(FirstParam.FirstGenericType.class) Closure c) { src.each { c.call(it) } }
Since
2.3.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from groovy.transform.stc.PickAnyArgumentHint:
getParameterTypes

Constructor Detail

FirstGenericTypeback to summary
public FirstGenericType()
groovy.transform.stc back to summary

public Class FirstParam.SecondGenericType

extends PickAnyArgumentHint
Class Inheritance

A hint used to instruct the type checker to pick the second generic type of the first parameter type. For example:

void <T,U> doWithElements(Tuple<T,U> src, @ClosureParams(FirstParam.SecondGenericType.class) Closure c) { src.each { c.call(it) } }
Since
2.3.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from groovy.transform.stc.PickAnyArgumentHint:
getParameterTypes

Constructor Detail

SecondGenericTypeback to summary
public SecondGenericType()
groovy.transform.stc back to summary

public Class FirstParam.ThirdGenericType

extends PickAnyArgumentHint
Class Inheritance

A hint used to instruct the type checker to pick the third generic type of the first parameter type. For example:

void <T,U,V> doWithElements(Triple<T,U,V> src, @ClosureParams(FirstParam.ThirdGenericType.class) Closure c) { src.each { c.call(it) } }
Since
2.3.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from groovy.transform.stc.PickAnyArgumentHint:
getParameterTypes

Constructor Detail

ThirdGenericTypeback to summary
public ThirdGenericType()