Package org.eclipse.sisu
Annotation Type Parameters
-
@Target({FIELD,PARAMETER,METHOD}) @Retention(RUNTIME) @Documented @Qualifier public @interface Parameters
Qualifier
of 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 theMap
of system properties. External parameters can be supplied to Sisu by using the appropriate type along with theParameters
binding 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 wrapWireModule
around your set of application modules then it will merge multiple @Parameters
bindings; for maps by providing an aggregate view over all bound maps, for arrays by appending their elements into a single argument array.