Top Description Inners Constructors Methods
groovy.transform.stc

public Class SecondParam

extends PickAnyArgumentHint
Class Inheritance
Known Direct Subclasses
groovy.transform.stc.SecondParam.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 second parameter type. For example:

public <T,U> def doWith(T first, U second, @ClosureParams(SecondParam.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
SecondParam.Component

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

public static class
SecondParam.FirstGenericType

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

public static class
SecondParam.SecondGenericType

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

public static class
SecondParam.ThirdGenericType

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from groovy.transform.stc.PickAnyArgumentHint:
getParameterTypes

Constructor Detail

SecondParamback to summary
public SecondParam()
groovy.transform.stc back to summary

public Class SecondParam.Component

extends SecondParam
Class Inheritance

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

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

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 SecondParam.FirstGenericType

extends PickAnyArgumentHint
Class Inheritance

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

void <T> doWithElements(String base, List<T> src, @ClosureParams(SecondParam.FirstGenericType.class) Closure c) { ... } }
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 SecondParam.SecondGenericType

extends PickAnyArgumentHint
Class Inheritance

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

void <T,U> doWithElements(String base, Tuple<T,U> src, @ClosureParams(SecondParam.SecondGenericType.class) Closure c) { ... }
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 SecondParam.ThirdGenericType

extends PickAnyArgumentHint
Class Inheritance

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

void <T,U,V> doWithElements(String base, Triple<T,U,V> src, @ClosureParams(SecondParam.ThirdGenericType.class) Closure c) { ... }
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()