Package nz.org.riskscape.picocli
Interface CommandLine.IDefaultValueProvider
- All Known Implementing Classes:
CommandLine.PropertiesDefaultProvider
- Enclosing class:
- CommandLine
public static interface CommandLine.IDefaultValueProvider
Provides default value for a command. Commands may configure a provider with the
CommandLine.Command.defaultValueProvider() annotation attribute.
-
Method Summary
Modifier and TypeMethodDescriptiondefaultValue(CommandLine.Model.ArgSpec argSpec) Returns the default value for an option or positional parameter ornull.
-
Method Details
-
defaultValue
Returns the default value for an option or positional parameter ornull. The returned value is converted to the type of the option/positional parameter via the same type converter used when populating this option/positional parameter from a command line argument.- Parameters:
argSpec- the option or positional parameter, nevernull- Returns:
- the default value for the option or positional parameter, or
nullif this provider has no default value for the specified option or positional parameter - Throws:
Exception- when there was a problem obtaining the default value
-