fujaba / fulibFx

A framework for JavaFX applications that is designed for MVC pattern projects.
https://fujaba.github.io/fulibFx/
MIT License
2 stars 0 forks source link

Repeatable OnKey #109

Closed Clashsoft closed 5 months ago

Clashsoft commented 5 months ago

Is your feature request related to a problem? Please describe. It is not possible to put multiple @OnKey annotations on a single method, because OnKey is not repeatable.

Describe the solution you'd like We should add a second annotation class OnKeys and make OnKey repeatable.

public @interface OnKeys {
    OnKey[] value();
}

@Repeatable(OnKeys.class)
public @interface OnKey {
  // ...
}

In the reflection and generator implementations, we can then use getAnnotationsByType(OnKey.class).

Describe alternatives you've considered Having multiple methods with different names, that call a single method. This introduces additional boilerplate.

Additional context See https://docs.oracle.com/javase/tutorial/java/annotations/repeating.html