Default configuration property name for @ConfigProperty on a parameter?

11 views
Skip to first unread message

Laird Nelson

unread,
May 6, 2019, 4:53:15 PM5/6/19
to Eclipse MicroProfile
The specification says:

"If it [the name element of ConfigProperty] is not specified, it will be derived automatically as <class_name>.<injetion_point_name> [sic], where injection_point_name [sic] is the field name or parameter name, class_name is the fully qualified name of the class being injected to."

If I have:

package com.foobar;
import org.eclipse.microprofile.config.inject.ConfigProperty;
public class Frobnicator {
  public void frobnicate(@ConfigProperty final int frobnicationInterval) {}
}

…and assuming my class has been compiled with support for parameter names, what is the name of the configuration property that a MicroProfile Config 1.3-compliant implementation must seek?

The specification implies that it is:

com.foobar.Frobnicator.frobnicationInterval

Is that correct?

Furthermore, I assume that the "fully qualified name of the class" must actually be the return value from Class#getCanonicalName() (so as to rule out dollar signs and whatnot in the name)?

Best,
Laird
Reply all
Reply to author
Forward
0 new messages