meta

packagemeta

When defining a field, the Scala compiler creates up to four accessors
for it: a getter, a setter, and if the field is annotated with
@BeanProperty, a bean getter and a bean setter.

For instance in the following class definition

class C(@myAnnot @BeanPropertyvar c: Int)

there are six entities which can carry the annotation @myAnnot: the
constructor parameter, the generated field and the four accessors.

By default, annotations on (val-, var- or plain) constructor parameters
end up on the parameter, not on any other entity. Annotations on fields
by default only end up on the field.

The meta-annotations in package scala.annotation.meta are used
to control where annotations on fields and class parameters are copied.
This is done by annotating either the annotation type or the annotation
class with one or several of the meta-annotations in this package.

Annotating the annotation type

The target meta-annotations can be put on the annotation type when
instantiating the annotation. In the following example, the annotation
@Id will be added only to the bean getter getX.

When defining an implicit class, the Scala compiler creates an implicit
conversion method for it.

When defining an implicit class, the Scala compiler creates an implicit
conversion method for it. Annotations @companionClass and @companionMethod
control where an annotation on the implicit class will go. By default, annotations
on an implicit class end up only on the class.

When defining an implicit class, the Scala compiler creates an implicit
conversion method for it.

When defining an implicit class, the Scala compiler creates an implicit
conversion method for it. Annotations @companionClass and @companionMethod
control where an annotation on the implicit class will go. By default, annotations
on an implicit class end up only on the class.