polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@hedhman.org>
Subject Re: Repeating annotations
Date Sun, 06 Sep 2015 07:34:57 GMT
There is already an Jira issue on this.

I think it is good and straight forward, so go ahead.


On Sun, Sep 6, 2015 at 3:05 AM, Kent SĂžlvsten <kent.soelvsten@gmail.com>
wrote:

> I just stumbled upon a new java8 feature that might be useful.
>
> Repeating annotations.
>
> Instead of
>
> we could do
>
> @Mixins( { AssociationMixin.class, ManyAssociationMixin.class,
> NamedAssociationMixin.class } )
> public interface EntityComposite
>
> we could do
>
> @Mixin( AssociationMixin.class)
> @Mixin( ManyAssociationMixin.class) @Mixin( NamedAssociationMixin.class)
> public interface EntityComposite
>
> where the mixin annotation is defined essentially as
>
> @Repeatable( Mixins.class)
> public @interface Mixin {
>     Class<?>[] value();
> }
>
>
> Should be simple to add, and some users may find te notation more
> pleasing to the eye.
> It might even make it more natural to add more parameters to the
> annotations down te road
> (eg allow the user of the mixin to decide the @AppliesTo filter)
>
> WDYT?
>
> /Kent
>



-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message