AnnotationCollectorTransform (Groovy 2.4.16)
Date: 2018-12-09

org.codehaus.groovy.transform

## Class AnnotationCollectorTransform

- java.lang.Object
- - org.codehaus.groovy.transform.AnnotationCollectorTransform

- Direct Known Subclasses:
    CompileDynamicProcessor

      public class AnnotationCollectorTransform
      extends java.lang.Object

  This class is the base for any annotation alias processor.
  Author:
    Jochen "blackdrag" Theodorou
  See Also:
    `AnnotationCollector`, `visit(AnnotationNode, AnnotationNode, AnnotatedNode, SourceUnit)`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AnnotationCollectorTransform.ClassChanger` Class used by `CompilationUnit` to transform the alias class into what is needed by the compiler.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AnnotationCollectorTransform()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addError(java.lang.String message, ASTNode node, SourceUnit source)` Adds a new syntax error to the source unit and then continues.
    `protected java.util.List<AnnotationNode>` | `getTargetAnnotationList(AnnotationNode collector, AnnotationNode aliasAnnotationUsage, SourceUnit source)` Returns a list of AnnotationNodes for the value attribute of the given AnnotationNode.
    `java.util.List<AnnotationNode>` | `visit(AnnotationNode collector, AnnotationNode aliasAnnotationUsage, AnnotatedNode aliasAnnotated, SourceUnit source)` Implementation method of the alias annotation processor.

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

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

- - ### Constructor Detail

    - #### AnnotationCollectorTransform

          public AnnotationCollectorTransform()

  - ### Method Detail

    - #### addError

          protected void addError(java.lang.String message,
                                  ASTNode node,
                                  SourceUnit source)

      Adds a new syntax error to the source unit and then continues.
      Parameters:
        `message` - the message
        `node` - the node for the error report
        `source` - the source unit for the error report

    - #### getTargetAnnotationList

          protected java.util.List<AnnotationNode> getTargetAnnotationList(AnnotationNode collector,
                                                                           AnnotationNode aliasAnnotationUsage,
                                                                           SourceUnit source)

      Returns a list of AnnotationNodes for the value attribute of the given AnnotationNode.
      Parameters:
        `collector` - the node containing the value member with the list
        `source` - the source unit for error reporting
      Returns:
        a list of string constants

    - #### visit

          public java.util.List<AnnotationNode> visit(AnnotationNode collector,
                                                      AnnotationNode aliasAnnotationUsage,
                                                      AnnotatedNode aliasAnnotated,
                                                      SourceUnit source)

      Implementation method of the alias annotation processor. This method will get the list of annotations we aliased from the collector and adds it to aliasAnnotationUsage. The method will also map all members from aliasAnnotationUsage to the aliased nodes. Should a member stay unmapped, we will ad an error. Further processing of those members is done by the annotations.
      Parameters:
        `collector` - reference to the annotation with `AnnotationCollector`
        `aliasAnnotationUsage` - reference to the place of usage of the alias
        `aliasAnnotated` - reference to the node that has been annotated by the alias
        `source` - source unit for error reporting
      Returns:
        list of the new AnnotationNodes