@SubtypeOf(value=UnknownKeyFor.class) @Documented @Retention(value=RUNTIME) @Target(value={TYPE_USE,TYPE_PARAMETER}) public @interface KeyFor
The value of the annotation is the reference name of the map. Suppose that config
is a
Map<String, String>
. Then the declaration
@KeyFor("config") String key = "HOSTNAME";
indicates that "HOSTNAME" is a key in config
.
The value of the annotation can also be a set of reference names of the maps. If defaultConfig
is also a Map<String, String>
, then
@KeyFor({"config","defaultConfig"}) String key = "HOSTNAME";
indicates that "HOSTNAME" is a key in config
and in defaultConfig
.Modifier and Type | Required Element and Description |
---|---|
java.lang.String[] |
value
Java expression(s) that evaluate to a map for which the annotated type is a key.
|
public abstract java.lang.String[] value