-
Notifications
You must be signed in to change notification settings - Fork 0
Injectable parameter types
Functions, Suppliers and Predicates rely on the implementation(s) of FunctionRegistry to instantiate them based on the definitions in the YML configuration file. These types had very strict rules (or limitations even) in the first versions but these limitations are more relaxed now and certainly this is not the end of the road for these.
In these cases we need to differentiate between two cases: annotated and non-annotated. Please find more details of these below.
As of version v1.2.x
the following input parameter types were available for injection for the parameters annotated with
the new annotation types introduced by this release. These new annotations provide better nullability support, more compact
and more descriptive way of marking parameter types, and flexible, automatic name resolution.
- String
- Collection < String >
- Map < String, RawConfigParam >
- Collection < Map < String, RawConfigParam > >
These annotations became deprecated with the release of v1.2.x
but are in theory suitable to support all of the options above.
Complete removal of this annotation can be expected in the v1.3.x
release.
As one of the new features introduced in v1.2.x
we can now mark classes later used as Spring beans as
@Injectable.
This annotation needs to be placed on the class of which the bean will be an instance of (not the interface, but the class
implementing it instead). The annotation itself defines which type we should look for when a parameter is evaluated before
injection. In case multiple beans of the same class would be present in the context, provided that Spring knows about
the fact that they are injected (the bean counts as injected with @Injectable
as well, then we will look for a parameter
named the same way as the bean name or annotated with either @Qualifier
or @Named to specify the bean name.
The currently supported injectable beans are the following.