diff --git a/src/main/java/io/reflectoring/reviewapp/common/OutputAdapter.java b/src/main/java/io/reflectoring/reviewapp/common/OutputAdapter.java new file mode 100644 index 0000000..4553c59 --- /dev/null +++ b/src/main/java/io/reflectoring/reviewapp/common/OutputAdapter.java @@ -0,0 +1,26 @@ +package io.reflectoring.reviewapp.common; + +import org.springframework.core.annotation.AliasFor; +import org.springframework.stereotype.Component; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Component +public @interface OutputAdapter { + + /** + * The value may indicate a suggestion for a logical component name, + * to be turned into a Spring bean in case of an autodetected component. + * @return the suggested component name, if any (or empty String otherwise) + */ + @AliasFor(annotation = Component.class) + String value() default ""; + +} diff --git a/src/main/java/io/reflectoring/reviewapp/common/PersistenceAdapter.java b/src/main/java/io/reflectoring/reviewapp/common/PersistenceAdapter.java new file mode 100644 index 0000000..6fb6701 --- /dev/null +++ b/src/main/java/io/reflectoring/reviewapp/common/PersistenceAdapter.java @@ -0,0 +1,27 @@ +package io.reflectoring.reviewapp.common; + +import org.springframework.core.annotation.AliasFor; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Repository; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Component +public @interface PersistenceAdapter { + + /** + * The value may indicate a suggestion for a logical component name, + * to be turned into a Spring bean in case of an autodetected component. + * @return the suggested component name, if any (or empty String otherwise) + */ + @AliasFor(annotation = Component.class) + String value() default ""; + +} diff --git a/src/main/java/io/reflectoring/reviewapp/common/UseCase.java b/src/main/java/io/reflectoring/reviewapp/common/UseCase.java new file mode 100644 index 0000000..d9abec1 --- /dev/null +++ b/src/main/java/io/reflectoring/reviewapp/common/UseCase.java @@ -0,0 +1,26 @@ +package io.reflectoring.reviewapp.common; + +import org.springframework.core.annotation.AliasFor; +import org.springframework.stereotype.Component; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Component +public @interface UseCase { + + /** + * The value may indicate a suggestion for a logical component name, + * to be turned into a Spring bean in case of an autodetected component. + * @return the suggested component name, if any (or empty String otherwise) + */ + @AliasFor(annotation = Component.class) + String value() default ""; + +} diff --git a/src/main/java/io/reflectoring/reviewapp/common/WebAdapter.java b/src/main/java/io/reflectoring/reviewapp/common/WebAdapter.java new file mode 100644 index 0000000..879f2e9 --- /dev/null +++ b/src/main/java/io/reflectoring/reviewapp/common/WebAdapter.java @@ -0,0 +1,26 @@ +package io.reflectoring.reviewapp.common; + +import org.springframework.core.annotation.AliasFor; +import org.springframework.stereotype.Component; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Component +public @interface WebAdapter { + + /** + * The value may indicate a suggestion for a logical component name, + * to be turned into a Spring bean in case of an autodetected component. + * @return the suggested component name, if any (or empty String otherwise) + */ + @AliasFor(annotation = Component.class) + String value() default ""; + +}