diff --git a/tweed5/construct/src/main/java/de/siphalor/tweed5/construct/api/TweedConstruct.java b/tweed5/construct/src/main/java/de/siphalor/tweed5/construct/api/TweedConstruct.java index daf1655..5d221c6 100644 --- a/tweed5/construct/src/main/java/de/siphalor/tweed5/construct/api/TweedConstruct.java +++ b/tweed5/construct/src/main/java/de/siphalor/tweed5/construct/api/TweedConstruct.java @@ -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}. *

* 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 { diff --git a/tweed5/construct/src/main/java/de/siphalor/tweed5/construct/api/TweedConstructs.java b/tweed5/construct/src/main/java/de/siphalor/tweed5/construct/api/TweedConstructs.java new file mode 100644 index 0000000..1705ff8 --- /dev/null +++ b/tweed5/construct/src/main/java/de/siphalor/tweed5/construct/api/TweedConstructs.java @@ -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(); +}