Package org.eclipse.sisu
Annotation Type Parameters
-
@Target({FIELD,PARAMETER,METHOD}) @Retention(RUNTIME) @Documented @Qualifier public @interface Parameters
Qualifierof application parameters:
@Inject @Parameters String[] args; @Inject @Parameters Map<?, ?> properties;
This qualifier marks collections of values that act as overall application parameters, like the
String[]argument array passed into the main method or theMapof system properties. External parameters can be supplied to Sisu by using the appropriate type along with theParametersbinding annotation.// add @Named for automatic installation public class MyParametersModule extends AbstractModule { @Provides @Parameters String[] customArgs() { return myArgs; } @Provides @Parameters Map<?, ?> customProperties() { return myProperties; } @Override protected void configure() { // other setup } }Tip: if you wrapWireModulearound your set of application modules then it will merge multiple @Parametersbindings; for maps by providing an aggregate view over all bound maps, for arrays by appending their elements into a single argument array.