InjectAnnotation should allow injecting annotation on factory method
See original GitHub issue@InjectAnnotation
can be used to place an annotation on the constructor of the immutable type using target = Where.CONSTRUCTOR
. This is great, but it requires me to use @Value.Style(of = "new")
which in turn prevents me from using normalization:
Interning, singleton and validation will not work correctly with ‘new’ constructor configured in style
It would be great if the Annotation would be placed on the static factory method when no public constructor is generated or if there was something like a Where.FACTORY_METHOD
that could be used instead of Where.CONSTRUCTOR
in such a case.
Issue Analytics
- State:
- Created a year ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Dependency injection and programmatic lookup
The @Inject annotation lets us define an injection point that is injected during bean instantiation. Injection can occur via three different ...
Read more >Wiring in Spring: @Autowired, @Resource and @Inject
This article will compare and contrast the use of annotations related to dependency injection, namely the @Resource, @Inject, and @Autowired ...
Read more >Contexts and Dependency Injection - Quarkus
This annotation can be declared on a class, a producer method or field. Since this is not always possible, there is an option...
Read more >Java: Junit a class with Inject annotation - Stack Overflow
If you use a MockitoJUnitRunner , you can use @Mock to create a mock for the Factory and inject it. @RunWith(MockitoJUnitRunner.class) ...
Read more >Dependency injection with Dagger 2: @Inject and @Provides
Dependency Injection, or DI in short, is a design pattern that allows ... Each class has an empty constructor with the @Inject annotation....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just a small reminder: I still look forward to the release 😉
2.9.3 released