Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sisu-users] collection on named components?

Thank you, Stuart. I managed to make this work with BeanLocator. The
same problem also affects custom @Qualifier annotations, btw, it is not
limited to @Named annotations.

--
Regards,
Igor

On 2014-10-08, 19:57, Stuart McCulloch wrote:
Hi Igor,

This sounds similar to
https://bugs.eclipse.org/bugs/show_bug.cgi?id=386432 which is currently
in the backlog.

It should be just a matter of extending the code in LocatorWiring to
handle the case where the key has an actual annotation value like
@Named(“foo”) and is not just @Named

Though it probably makes more sense if we also consider introducing an
alternative form of @Named which accepts a sequence strings.

Until this is implemented you could inject Map<String, Component> and
then iterate over the entry set filtering on the name - even though it’s
a set the entries will be ordered by priority.

--
Cheers, Stuart

On Wednesday, 8 October 2014 at 21:55, Igor Fedorenko wrote:

Is there a way to inject multiple @Named components with the same name
but different priority? I was hoping something like this would work, but
it tries to inject literal collection, not a collection of components
with this name.

@Named("foo")
List<Component> components;

I am not sure if this even makes sense :-)

--
Regards,
Igor
_______________________________________________
sisu-users mailing list
sisu-users@xxxxxxxxxxx <mailto:sisu-users@xxxxxxxxxxx>
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sisu-users



_______________________________________________
sisu-users mailing list
sisu-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sisu-users



Back to the top