chore: make MultipleTargets into a subclass of Target

This commit is contained in:
zaaarf 2023-05-03 16:42:16 +02:00
parent 999f0500c7
commit 34f8ded1a8
No known key found for this signature in database
GPG key ID: 82240E075E31FA4C
2 changed files with 14 additions and 20 deletions

View file

@ -1,19 +0,0 @@
package ftbsc.lll.processor.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Used to support {@link Target} as a {@link Repeatable} annotation.
* @since 0.5.0
*/
@Retention(RetentionPolicy.CLASS)
@java.lang.annotation.Target(ElementType.METHOD)
public @interface MultipleTargets {
/**
* @return the {@link Injector} annotations, as an array
*/
Target[] value();
}

View file

@ -15,7 +15,7 @@ import java.lang.annotation.RetentionPolicy;
* @see Injector * @see Injector
*/ */
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Repeatable(MultipleTargets.class) @Repeatable(Target.List.class)
@java.lang.annotation.Target(ElementType.METHOD) @java.lang.annotation.Target(ElementType.METHOD)
public @interface Target { public @interface Target {
@ -52,4 +52,17 @@ public @interface Target {
* @since 0.5.2 * @since 0.5.2
*/ */
boolean bridge() default false; boolean bridge() default false;
/**
* Used to support {@link Target} as a {@link Repeatable} annotation.
* @since 0.6.1
*/
@Retention(RetentionPolicy.CLASS)
@java.lang.annotation.Target(ElementType.METHOD)
@interface List {
/**
* @return the {@link Injector} annotations, as an array
*/
Target[] value();
}
} }