Class AnnotationCollectorTransform

Direct Known Subclasses:

public class AnnotationCollectorTransform extends Object
This class is the base for any annotation alias processor.
See Also:
  • Constructor Details

    • AnnotationCollectorTransform

      public AnnotationCollectorTransform()
  • Method Details

    • addError

      protected void addError(String message, ASTNode node, SourceUnit source)
      Adds a new syntax error to the source unit and then continues.
      message - the message
      node - the node for the error report
      source - the source unit for the error report
    • getTargetAnnotationList

      protected List<AnnotationNode> getTargetAnnotationList(AnnotationNode collector, AnnotationNode aliasAnnotationUsage, SourceUnit source)
      Returns a list of AnnotationNodes for the value attribute of the given AnnotationNode.
      collector - the node containing the value member with the list
      source - the source unit for error reporting
      a list of string constants
    • visit

      public 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 add an error. Further processing of those members is done by the annotations.
      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
      list of the new AnnotationNodes