[cdi-dev] [JBoss JIRA] (CDI-695) Allow stereotypes to include priority annotations

Martin Kouba (JIRA) issues at jboss.org
Fri Sep 14 08:46:01 EDT 2018


    [ https://issues.jboss.org/browse/CDI-695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13633647#comment-13633647 ] 

Martin Kouba commented on CDI-695:
----------------------------------

I also think this could be useful. And use case? I can imagine a stereotype used in testing:
{code:java}
@Alternative 
@SuperCoolInterceptorBinding
@Stereotype
@Target(TYPE)
@Retention(RUNTIME)
public @interface TestReplacement {}

@Priority(1)
@TestReplacement
class TestFoo extends Foo {
}
{code}
could be simply replaced with:
{code:java}
@Alternative
@Priority(1)
@SuperCoolInterceptorBinding
@Stereotype
@Target(TYPE)
@Retention(RUNTIME)
public @interface TestReplacement {}

@TestReplacement
class TestFoo extends Foo {
}
{code}

However, note that this would require a change in commons annotations - the {{@Priority}} target is currently {{@Target(value={*TYPE,PARAMETER*})}}.

> Allow stereotypes to include priority annotations
> -------------------------------------------------
>
>                 Key: CDI-695
>                 URL: https://issues.jboss.org/browse/CDI-695
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>            Reporter: John Ament
>
> Stereotypes can include things like Alternative.  However, there is no mention as to whether or not Priority can be included in the stereotype definition.  I feel it would be useful to be included.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the cdi-dev mailing list