Generated Mixin
Indicates an interface which is used for extending generated code using default methods declared in the interface.
In order to generate a class which implements a custom interface:
- Create the interface and mark it with this annotation.
- Declare methods of interest following the Protobuf convention for the accessor methods. For example, if a message has a property named
foo_bar, the method to declare will begetFooBar(). - Add
defaultmethods. Presumably bodies of these methods will call accessor methods declared earlier. - Mark corresponding proto messages using the
(is).java_typeoption (if for one message), or(every_is).java_typeoption for a file, if the interface is common for all the message declared in this file. These options instruct Spine Model Compiler to make the generated code implement this interface.
The annotation should NOT be used on interfaces that do not provide default methods, as implementing classes would not be mixins.
See also
io. spine. option. IsOption