AnnotationAggregate

made.annotation.AnnotationAggregate

Base trait for annotations that aggregate multiple other annotations. An aggregate annotation works like an "annotation function" — applying it to a symbol behaves as if all the annotations declared on its aggregated method were applied directly.

To declare an aggregate, extend AnnotationAggregate and implement the aggregated method via the reifyAggregated macro. The aggregated annotations must be declared on that implementation method itself. The implementation must be final.

Constructor parameters of the aggregate may be referenced as arguments to inner annotations and will be substituted at the application site:

 class customName(name: String) extends AnnotationAggregate {
   @name(name)
   final def aggregated: List[StaticAnnotation] = reifyAggregated
 }

Made's annotation lookup machinery (hasAnnotation/getAnnotation on mirror elements, label resolution and metadata) automatically expands aggregates so that downstream code sees the underlying annotations directly.

Attributes

Graph
Supertypes
class Annotation
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

Returns the aggregated annotations. Implement with reifyAggregated and declare the aggregated annotations on this method.

Returns the aggregated annotations. Implement with reifyAggregated and declare the aggregated annotations on this method.

Attributes

Concrete methods

inline protected def reifyAggregated: List[StaticAnnotation]