How can I create a new annotation based on a Spring @Service
annotation or @Component
?
I want just to change the name for a more semantic use: for example change the name to @TransactionelService
.
You can create your own annotation (e.g. @MyComponent
) annotated with the corresponding spring annotation. For example:
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
public @interface MyComponent {
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With