Package groovy.transform.stc

# Class SecondParam.Component

java.lang.Object
groovy.transform.stc.ClosureSignatureHint
groovy.transform.stc.SingleSignatureClosureHint
groovy.transform.stc.PickAnyArgumentHint
groovy.transform.stc.SecondParam
groovy.transform.stc.SecondParam.Component

Enclosing class:
  SecondParam

public static class SecondParam.Component extends 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) { ... }`

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class groovy.transform.stc.SecondParam

  `SecondParam.Component, SecondParam.FirstGenericType, SecondParam.SecondGenericType, SecondParam.ThirdGenericType`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Component()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ClassNode[]`
  `getParameterTypes(MethodNode node, String[] options, SourceUnit sourceUnit, CompilationUnit unit, ASTNode usage)`
  Returns the single parameter signature accepted by the hinted closure.

  ### Methods inherited from class groovy.transform.stc.SingleSignatureClosureHint

  `getClosureSignatures`

  ### Methods inherited from class groovy.transform.stc.ClosureSignatureHint

  `findClassNode, pickGenericType, pickGenericType`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Component

    public Component()

- ## Method Details

  - ### getParameterTypes

    public ClassNode[] getParameterTypes(MethodNode node, String[] options, SourceUnit sourceUnit, CompilationUnit unit, ASTNode usage)
    Returns the single parameter signature accepted by the hinted closure.
    Overrides:
      `getParameterTypes` in class `PickAnyArgumentHint`
    Parameters:
      `node` - the annotated method node
      `options` - the hint options
      `sourceUnit` - the current source unit
      `unit` - the current compilation unit
      `usage` - the closure expression or related AST node
    Returns:
      the inferred parameter types