Package: org.codehaus.groovy.transform

## [Groovy] Class TimedInterruptibleASTTransformation

- org.codehaus.groovy.transform.TimedInterruptibleASTTransformation

-     @AutoFinal
      @CompileStatic
      @GroovyASTTransformation
      class TimedInterruptibleASTTransformation
      extends AbstractASTTransformation

  Allows "interrupt-safe" executions of scripts by adding timer expiration checks on loops (for, while, do) and first statement of closures. By default, also adds an interrupt check statement on the beginning of method calls.

  See Also:
    ThreadInterrupt
  Since:
    1.8.0

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class AbstractASTTransformation` | `RETENTION_CLASSNODE, sourceUnit`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `TimedInterruptibleASTTransformation()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `static Object` | `getConstantAnnotationParameter(AnnotationNode node, String parameterName, Class type, Object defaultValue)` Resolves a constant annotation member, coercing it to the requested type when possible.
    `` | `void` | `visit(ASTNode[] nodes, SourceUnit source)` Applies the timed interrupt transformation to the annotated target.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractASTTransformation` | `addError, checkIncludeExcludeUndefinedAware, checkIncludeExcludeUndefinedAware, checkNotInterface, checkPropertyList, checkPropertyList, checkPropertyList, copyAnnotatedNodeAnnotations, copyAnnotatedNodeAnnotations, deemedInternal, deemedInternalName, getAnnotationName, getMemberClassList, getMemberClassValue, getMemberClassValue, getMemberIntValue, getMemberStringList, getMemberStringValue, getMemberStringValue, getMemberValue, hasAnnotation, init, markAsInternal, memberHasValue, shouldSkip, shouldSkip, shouldSkip, shouldSkipOnDescriptorUndefinedAware, shouldSkipUndefinedAware, shouldSkipUndefinedAware, shouldSkipUndefinedAware, tokenize`

- - ### Constructor Detail

    - #### TimedInterruptibleASTTransformation()

  - ### Method Detail

    - #### static Object getConstantAnnotationParameter(AnnotationNode node, String parameterName, Class type, Object defaultValue)

      Resolves a constant annotation member, coercing it to the requested type when possible.

      Parameters:
        `node` - the annotation node to inspect
        `parameterName` - the member name to resolve
        `type` - the expected value type
        `defaultValue` - the fallback value when the member is absent
      Returns:
        the resolved constant value or `defaultValue`

    - #### @Override
      void visit(ASTNode[] nodes, SourceUnit source)

      Applies the timed interrupt transformation to the annotated target.

      Parameters:
        `nodes` - the annotation node and annotated AST node
        `source` - the source unit containing the annotation