views:

5

answers:

0

It's clear to me how to inject an object which is in my domain (I have access to the source) using Weld. You just annotate the implementation with e.g. @Named and @ApplicationScoped, and then annotate the target attribute with @Inject to get the implementation injected.

However, not sure how can I inject implementations of classes which I don't have access to its source code. For example, I am using Dozer. Dozer mapper is programmed against an interface (Mapper) and I want Weld to inject the implementation (DozerBeanMapper), but since I don't have access to the source cause I am using a .jar dependency, I cannot annotate it.

Any ideas on how to achieve this?