org.neovera.jdiablo
Interface OptionValueProvider

All Known Implementing Classes:
ClasspathOptions, SpringContextProvider

public interface OptionValueProvider

Core interface that "value providers" should implement. Value providers attempt to satisfy command line options through other means (e.g., annotation against Class, resource in classpath, Spring properties, etc.). Required options that are populated via option value providers turn "optional" and don't need to be populated via command line arguments. If an option's value is provided for such an option via command line arguments, optionValueProvider provided value is overridden. Example: A classpath resource based option value provider may load a well-known resources file and then look for keys that are named using the option's longOption value. It can then use such values to populate the options with "default" values.


Method Summary
 void provideOptionValues(Class<? extends Environment> clz, Environment environment, List<? extends OptionPropertyAccessor> list, Class<? extends Launchable> launchableClass, Launchable launchable)
          Called for each environment being used.
 void provideOptionValues(Class<? extends Launchable> launchableClass, Launchable launchable, List<? extends OptionPropertyAccessor> launchProperties)
          Callback to setup the target (launchable instance) with "default" options using this option provider.
 

Method Detail

provideOptionValues

void provideOptionValues(Class<? extends Environment> clz,
                         Environment environment,
                         List<? extends OptionPropertyAccessor> list,
                         Class<? extends Launchable> launchableClass,
                         Launchable launchable)
Called for each environment being used.

Parameters:
clz - Class of the environment (often different from environment.getClass()).
environment - Environment instance.
list - List of properties relevant to the environment.
launchableClass - "Main"'s class.
launchable - Main instance.

provideOptionValues

void provideOptionValues(Class<? extends Launchable> launchableClass,
                         Launchable launchable,
                         List<? extends OptionPropertyAccessor> launchProperties)
Callback to setup the target (launchable instance) with "default" options using this option provider.

Parameters:
launchableClass - Class of the "main" class (often different from launchable.getClass())
launchable - Main instance.
launchProperties - Option properties defined in the "main" launchable that may need to be populated by the OptionValueProvider.


Copyright © 2014 Neovera Inc.. All rights reserved.