Annotation héritant du comportement d'une autre annotation
Bonjour à tous,
Je vous explique mon problème. J'utilise l'annotation de Spring suivante :
Code:
1 2
|
@IfProfileValue(name = "test-group", value ="integration") |
Cependant je souhaitais la simplifier afin de pouvoir la standardiser sur tous les projets. J'ai donc pensé recréer une annotation comme ceci :
Code:
1 2 3 4 5
|
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@IfProfileValue(name = "test-group", value = "integration")
public @interface IntegrationTest {} |
Cependant ça ne fonctionne pas. Lorsque je remplace l'annotation Spring par la mienne (@IntegrationTest), le comportement de l'annotation Spring n'est pas hérité.
Pour info la signature de l'annotation @IfProfileValue est :
Code:
1 2 3 4 5 6 7 8
|
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface IfProfileValue {
...
} |
Une idée? Cela est-il réalisable simplement?
Merci!