@RegisterService(SomeOneElsesInterface.class)
public class MyImplOfSomeOneElsesInterface implements SomeOneElsesInterface {
...
}
The annotation (the related annoation processor) adds the MyImplOfSomeOneElsesInterface to the /META-INF/services/com.foo.bar.SomeOneElsesInterface file for the service loader.
The usecase for this annotation is to simplify the registration for the service loader for interfaces, that don't use this library on their own. And thus avoid issues due to renaming classes.
The annotation can probably use RetentionType.SOURCE as it isn't needed at runtime/for other dependencies.
Usage
The annotation (the related annoation processor) adds the
MyImplOfSomeOneElsesInterface
to the/META-INF/services/com.foo.bar.SomeOneElsesInterface
file for the service loader.The usecase for this annotation is to simplify the registration for the service loader for interfaces, that don't use this library on their own. And thus avoid issues due to renaming classes.
The annotation can probably use
RetentionType.SOURCE
as it isn't needed at runtime/for other dependencies.Other name suggestions for the annotation:
@RegisterForServiceLoader