groovy.lang

## Annotation Type DelegatesTo

-     @Documented
      @Retention(value=RUNTIME)
      @Target(value=PARAMETER)
      public @interface DelegatesTo

  This annotation can be used by API or DSL writers to document parameters which accept a closure. In that case, using this annotation, you can specify what the delegate type of the closure will be. This is important for IDE support.

  This annotation can also be used to help the type checker (`TypeChecked`) which would not report errors then if the delegate is of the documented type. Of course, it is also compatible with `CompileStatic`.

  Example:

       // Document the fact that the delegate of the closure will be an ExecSpec
       ExecResult exec(@DelegatesTo(ExecSpec) Closure closure) { ... }

  Since:
    2.1.0
  Author:
    Cedric Champeau, Peter Niderwieser

- - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `int` | `genericTypeIndex`
    `int` | `strategy`
    `String` | `target`
    `Class` | `value`

- - ### Element Detail

    - #### value

          public abstract Class value

      Default:
        groovy.lang.DelegatesTo.Target.class

    - #### strategy

          public abstract int strategy

      Default:
        0

    - #### genericTypeIndex

          public abstract int genericTypeIndex

      Default:
        -1

    - #### target

          public abstract String target

      Default:
        ""