Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.5.0
-
None
Description
it allows to use partial-bean methods also as simple producers of (qualified) types. the main use-case is about exposing injectable values without additional producer-classes since partial-beans are mainly about exposing values (and invoking generic-methods) easily. implication: we don't need to support disposer-methods for now.
example:
@TypeSafeConfig //partial-bean binding public interface Config { @Produces @ApplicationName //custom String name(); String version(); } //+ handler
that allows to inject Config and access the methods or just inject a string qualified with @ApplicationName. -> it's mainly a shortcut similar to producers based on BaseConfigPropertyProducer.
a version based on BaseConfigPropertyProducer would look like:
public class ConfigProducer extends BaseConfigPropertyProducer { @Produces @ApplicationName public String applicationName(InjectionPoint injectionPoint) { return getStringPropertyValue(injectionPoint); } }