[construct] Make construct annotation repeatable
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
package de.siphalor.tweed5.construct.api;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* Indicates a method or constructor that should be used for construction using {@link TweedConstructFactory}.
|
||||
* <p>
|
||||
* There must only be a single annotation for a certain target class on any constructor or static method of a class.
|
||||
*/
|
||||
@Repeatable(TweedConstructs.class)
|
||||
@Target({ElementType.CONSTRUCTOR, ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface TweedConstruct {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package de.siphalor.tweed5.construct.api;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Allows declaring multiple {@link TweedConstruct} annotations on a single element.
|
||||
* @see TweedConstruct
|
||||
*/
|
||||
@Target({ElementType.CONSTRUCTOR, ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface TweedConstructs {
|
||||
TweedConstruct[] value();
|
||||
}
|
||||
Reference in New Issue
Block a user