MandatoryValue

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

When the injector throws a ValueNotAvailableException, it is re-thrown instead of being suppressed.

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

struct MandatoryValue {}

Members

Variables

key
string key;

The textual key used to find the value by injectors.

Examples

class MyClass {
    @MandatoryValue("general.valueWhichShouldBeThere")
    private int number;
}

Meta