Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
With dm-lambda, you can't define service properties with dots when you use fluent service properties using lambda expressions.
For example, you can declare this component which provides a service using the "foo=bar" service property:
component(comp ->comp
.impl(ServiceImpl.class)
.provides(Service.class, foo -> "bar"))
but you can't use dots in the service property name (like "foo.bar=zoo"):
component(comp -> comp
.impl(ServiceImpl.class)
.provides(Service.class, foo.bar -> "zoo"))
Indeed, a lambda parameter name can't contain any dots. A convention can be used like in OSGi metatype, where underscore can be used to convert dots, and a double underscore is then converted to a single underscore, like this:
component(comp -> comp .impl(ServiceImpl.class) .provides(Service.class, foo_bar -> "zoo", foo__bar -> "zoo2"));
In the above example, foo_bar is then mapped to "foo.bar" service property name and foo__bar is then mapped to foo_bar property name.