CommandLine.IDefaultValueProvider (picocli 3.9.6 API)
Date: 2019-04-06

picocli

## Interface CommandLine.IDefaultValueProvider

- 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.
  Since:
    3.6

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `defaultValue(CommandLine.Model.ArgSpec argSpec)` Returns the default value for an option or positional parameter or `null`.

- - ### Method Detail

    - #### defaultValue

          java.lang.String defaultValue(CommandLine.Model.ArgSpec argSpec)
                                 throws java.lang.Exception

      Returns the default value for an option or positional parameter or `null`. 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, never `null`
      Returns:
        the default value for the option or positional parameter, or `null` if this provider has no default value for the specified option or positional parameter
      Throws:
        `java.lang.Exception` - when there was a problem obtaining the default value