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.
| Modifier and Type | Class 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:
|
| 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. |
| Access | Constructor and Description |
|---|---|
| public |
| SecondParam | back to summary |
|---|---|
| public SecondParam() | |
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) { ... }
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ClassNode[] | getParameterTypes(final MethodNode node, final String[] options, final SourceUnit sourceUnit, final CompilationUnit unit, final ASTNode usage)
Overrides groovy. |
| Component | back to summary |
|---|---|
| public Component() | |
| getParameterTypes | back to summary |
|---|---|
| public ClassNode[] getParameterTypes(final MethodNode node, final String[] options, final SourceUnit sourceUnit, final CompilationUnit unit, final ASTNode usage) Overrides groovy.
| |
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) { ... } }
| Access | Constructor and Description |
|---|---|
| public |
| FirstGenericType | back to summary |
|---|---|
| public FirstGenericType() | |
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) { ... }
| Access | Constructor and Description |
|---|---|
| public |
| SecondGenericType | back to summary |
|---|---|
| public SecondGenericType() | |
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) { ... }
| Access | Constructor and Description |
|---|---|
| public |
| ThirdGenericType | back to summary |
|---|---|
| public ThirdGenericType() | |