Class CommandLine.NullParameterConsumer
- java.lang.Object
-
- picocli.CommandLine.NullParameterConsumer
-
- All Implemented Interfaces:
CommandLine.IParameterConsumer
- Enclosing class:
- CommandLine
private static class CommandLine.NullParameterConsumer extends java.lang.Object implements CommandLine.IParameterConsumer
-
-
Constructor Summary
Constructors Modifier Constructor Description privateNullParameterConsumer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconsumeParameters(java.util.Stack<java.lang.String> args, CommandLine.Model.ArgSpec argSpec, CommandLine.Model.CommandSpec commandSpec)Consumes as many of the specified command line arguments as needed by popping them off the specified Stack.
-
-
-
Method Detail
-
consumeParameters
public void consumeParameters(java.util.Stack<java.lang.String> args, CommandLine.Model.ArgSpec argSpec, CommandLine.Model.CommandSpec commandSpec)Description copied from interface:CommandLine.IParameterConsumerConsumes as many of the specified command line arguments as needed by popping them off the specified Stack. Implementors are free to ignore the arity of the option or positional parameter, they are free to consume arguments that would normally be matched as other options of the command, and they are free to consume arguments that would normally be matched as an end-of-options delimiter.Implementors are responsible for saving the consumed values; if the user object of the option or positional parameter is a Collection or a Map, a common approach would be to obtain the current instance via the
CommandLine.Model.ArgSpec.getValue(), and add to this instance. If the user object is an array, the implementation would need to create a new array that contains the old values as well as the newly consumed values, and store this array in the user object via theCommandLine.Model.ArgSpec.setValue(Object).If the user input is invalid, implementations should throw a
CommandLine.ParameterExceptionwith a message to display to the user.When this method returns, the picocli parser will process the remaining arguments on the Stack.
- Specified by:
consumeParametersin interfaceCommandLine.IParameterConsumer- Parameters:
args- the command line argumentsargSpec- the option or positional parameter for which to consume command line argumentscommandSpec- the command that the option or positional parameter belongs to
-
-