A parameter consumer for interactively entering a value (e.g. a password). *
Similar to {@link Option#interactive()} and {@link Parameters#interactive()}.
* Picocli's interactive and JLine's {@link ConsoleReader} do not work well together.
* Thus delegating reading input to {@link ConsoleReader} should be preferred.
* @since 4.0
*/
public class InteractiveParameterConsumer implements IParameterConsumer {
private final ConsoleReader reader;
public InteractiveParameterConsumer(ConsoleReader reader) {
this.reader = reader;
}
public void consumeParameters(Stack Can serve for {@link #create(Class)} from a list of given instances or
* delegates to a {@link CommandLine#defaultFactory()} if no objects for class
* available.
* Usually this would be done with
* dependency injection.
* @since 4.0
* @see https://picocli.info/#_dependency_injection
*/
public class CustomFactory implements IFactory {
private final IFactory factory = CommandLine.defaultFactory();
private final List