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

Reply via email to