Struct Value

UDA used for marking class members which should be value-injected.

struct Value ;

A key must be supplied, which can be in any format depending on how a value injector reads it.

When the injector throws a ValueNotAvailableException, the value is not injected and will keep its original assignment.

Fields

NameTypeDescription
key stringThe textual key used to find the value by injectors.

Examples

class MyClass {
    @Value("general.importantNumber")
    private int number = 8;
}