trait AnnotationAggregate extends Annotation with StaticAnnotation
Base trait for annotations which aggregate multiple other annotations. This way annotation aggregates work like "annotation functions" - they are annotations that yield more annotations.
In order to specify aggregated annotations, the class that extends AnnotationAggregate
must
redefine the Implied
dummy type member and apply the aggregated annotations on it. Macro engines
used in GenCodec
materialization and RPC framework will automatically pick up these annotations.
import com.avsystem.commons.serialization._ class mongoId extends AnnotationAggregate { @name("_id") @outOfOrder type Implied } case class SomeMongoEntity(@mongoId id: String, data: String)
In the above example, applying @mongoId
annotation on the id
field has the same effect as if
annotations @name("_id") @outOfOrder
were applied directly on that field.
NOTE: thanks to the fact that aggregated annotations are applied on a type member you can pass the arguments of original annotation to aggregated annotations, e.g.
class rpcNameAndDescription(name: String, description: String) extends AnnotationAggregate { @rpcName(name) // passing `name` to aggregated annotation type Implied }
- Alphabetic
- By Inheritance
- AnnotationAggregate
- StaticAnnotation
- Annotation
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
abstract
type
Implied
Dummy type member meant to be redefined in order to have aggregated annotations applied on it.
Dummy type member meant to be redefined in order to have aggregated annotations applied on it. These annotations will be automatically picked up by macro engines each time they encounter the aggregating annotation itself. Other than being an "anchor" for annotations, this type member has no actual meaning and there is no reason to ever actually use it. NOTE: a less weird solution would be to put aggregated annotations on the aggregating annotation class itself, but this would make it impossible to access the arguments of aggregating annotation in aggregated annotations.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )