/** * Adds a new option to the list of Bootique CLI options. * * @param option a descriptor of the CLI option to be added to Bootique. * @return this extender instance. */ public BQCoreModuleExtender addOption(OptionMetadata option) { contributeOptions().addBinding().toInstance(option); return this; }
@Override public BQCoreModuleExtender initAllExtensions() { contributeConfigs(); contributeProperties(); contributeVariables(); contributeVariableDeclarations(); contributeLogLevels(); contributeOptions(); contributeCommands(); contributeCommandDecorators(); contributeOptionDecorators(); contributeValueObjectsDescriptors(); contributeOptionPathDecorators(); return this; }
/** * Adds a new option to the list of Bootique CLI options. * * @param option a descriptor of the CLI option to be added to Bootique. * @return this extender instance. */ public BQCoreModuleExtender addOption(OptionMetadata option) { contributeOptions().addBinding().toInstance(option); return this; }
/** * @param binder DI binder passed to the Module that invokes this method. * @return {@link Multibinder} for Bootique options. * @since 0.12 * @deprecated since 0.22 use {@link #extend(Binder)} to get an extender object, and * then call {@link BQCoreModuleExtender#addOption(OptionMetadata)}. */ @Deprecated public static Multibinder<OptionMetadata> contributeOptions(Binder binder) { return extend(binder).contributeOptions(); }
/** * Declares a new CLI option, associating its presence with a configuration resource. This way a single option * can be used to enable a complex configuration. * * @param configResourceId a resource path compatible with {@link io.bootique.resource.ResourceFactory} denoting * a configuration source. E.g. "a/b/my.yml", or "classpath:com/foo/another.yml". * @param name the name of the new CLI option. * @return this extender instance * @since 0.24 * @deprecated since 0.25. The new way of adding an option associated with a config file is by separately declaring * an option and then associating it with one or more configs via {@link #addConfigOnOption(String, String)}. */ @Deprecated public BQCoreModuleExtender addConfigResourceOption(String configResourceId, String name) { contributeOptions().addBinding().toInstance( OptionMetadata.builder(name) .configResource(configResourceId) .valueOptional() .build()); return this; }
/** * Declares a new CLI option, associating it with a config path. The option runtime value is assigned to the * configuration property denoted by the path. * * @param configPath a dot-separated "path" that navigates configuration tree to the desired property. E.g. * "jdbc.myds.password". * @param name the name of the new CLI option. * @return this extender instance * @since 0.24 */ public BQCoreModuleExtender addOption(String configPath, String name) { contributeOptions().addBinding().toInstance( OptionMetadata.builder(name) .configPath(configPath) .valueRequired() .build()); return this; }
/** * Declares a new CLI option, associating it with a config path. The option runtime value is assigned to the * configuration property denoted by the path. Default value provided here will be used if the option is present, * but no value is specified on the command line. * * @param configPath a dot-separated "path" that navigates configuration tree to the desired property. E.g. * "jdbc.myds.password". * @param defaultValue default option value * @param name the name of the new CLI option. * @return this extender instance * @since 0.24 */ public BQCoreModuleExtender addOption(String configPath, String defaultValue, String name) { contributeOptions().addBinding().toInstance( OptionMetadata.builder(name) .configPath(configPath) .defaultValue(defaultValue) .valueOptional() .build()); return this; }
@Override public BQCoreModuleExtender initAllExtensions() { contributeConfigs(); contributeProperties(); contributeVariables(); contributeVariableDeclarations(); contributeLogLevels(); contributeOptions(); contributeCommands(); contributeCommandDecorators(); contributeOptionDecorators(); return this; }