Changes to annotations

Annotations are a Gosu (and Java) syntax of adding metadata to a class declaration, or to part of a class, such as a method declaration. The “at” sign indicates usage of the annotation, for example @WebService. Some annotations take arguments.

In version 8.0, custom Gosu annotations were defined as classes that extend the interface IAnnotation. In version 9.0, the IAnnotation interface is deprecated, although any built-in annotations that use that annotation are not deprecated due to this change. Instead there is a new syntax for native annotations defined in Gosu using the annotation keyword. If you created any custom annotations with IAnnotation, begin to convert your annotations to the new syntax.

For the most part, using existing annotations from Gosu is unchanged. However, in version 8.0, native Java annotations required named arguments when used from Gosu, whereas Gosu IAnnotation annotations did not require named arguments. In version 9.0, argument names are now always optional for all annotations.

See also