@Target(value={TYPE,METHOD,FIELD,PARAMETER})
@Retention(value=RUNTIME)
public @interface Config
@Inject @Config Configuration config
(note that root configuration classes may be used without qualifier also for compatibility)@Inject @Config SubConfiguration sub@Inject @Config("property.path") String value. Value type
must match property declaration type (including generics).
Generics are mostly useful for collection classes: @Inject @Config("some.path) List<String> values;.
Binding without generic is impossible (you must use all available type information).
Note that only properties visible for writing are present: properties which jackson could read. Even dropwizard gude contains examples when configuration setter did not store value and use it immediately to create some other objects. Obviously such properties are impossible to "read back" and so impossible to bind.
Property visibility may also be affected by annotated getter absence: for example, suppose there are no getters and
@JsonProperty private String foo, private String bar then only annotated "foo" property would be
visible. When property getter is present - property will be found, even without annotations.
for available bindings| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.String |
value |