I need to mark some classes as Invokable - just to tell I can invoke methods of the class using reflection. But I don't like the idea of having an empty interface just for this purpose. Can this be done with annotations and still preserve behaviour on the example below? (I have never created my own annotations, so I'm not familiar with them in depth)
Example
class ClassOne implements Invokable {
}
class ClassTwo implements Invokable {
}
void someMethod(Invokable inv) {
}
Because of someMethod, you can't use annotations. Perhaps later you'll find that Invokable may need useful methods anyway.
Also, be sure to check out already existing interfaces like Callable, Future etc. before you re-invent the wheel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With