# Interface QCommandContextType

All Superinterfaces:
  `QLocalizationType`

All Known Implementing Classes:
  `QCommandContext`

@ProviderType public interface QCommandContextType extends QLocalizationType
The context of execution for a command. Typically used to give commands access to parsed, typed parameters.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `QCommandType`
  `command()`
  `SortedMap<String, QCommandOrGroupType>`
  `commandTree()`
  `QCommandStatus`
  `execute()`
  Execute the command.
  `PrintWriter`
  `output()`
  `List<String>`
  `parametersPositionalRaw()`
  `<T> Optional<T>`
  `parameterValue(QParameterNamed01<T> parameter)`
  `<T> T`
  `parameterValue(QParameterNamed1<T> parameter)`
  `<T> T`
  `parameterValue(QParameterPositional<T> parameter)`
  `<T> T`
  `parameterValueRequireNow(QParameterNamed01<T> parameter)`
  `<T> List<T>`
  `parameterValues(QParameterNamed0N<T> parameter)`
  `<T> List<T>`
  `parameterValues(QParameterNamed1N<T> parameter)`
  `QValueConverterDirectoryType`
  `valueConverters()`
  The value converters used to produce this context.

  ### Methods inherited from interface QLocalizationType

  `format, localize`

- ## Method Details

  - ### commandTree

    SortedMap<String, QCommandOrGroupType> commandTree()
    Returns:
      Access to the command tree

  - ### output

    PrintWriter output()
    Returns:
      The output writer

  - ### valueConverters

    QValueConverterDirectoryType valueConverters()
    The value converters used to produce this context.
    Returns:
      The value converters

  - ### command

    QCommandType command()
    Returns:
      The command to which this context belongs

  - ### parametersPositionalRaw

    List<String> parametersPositionalRaw()
    Returns:
      The raw positional parameters, if any

  - ### parameterValue

    <T> T parameterValue(QParameterPositional<T> parameter)
    Type Parameters:
      `T` - The parameter type
    Parameters:
      `parameter` - The parameter
    Returns:
      The value for the parameter

  - ### parameterValue

    <T> T parameterValue(QParameterNamed1<T> parameter)
    Type Parameters:
      `T` - The parameter type
    Parameters:
      `parameter` - The parameter
    Returns:
      The value for the parameter

  - ### parameterValue

    <T> Optional<T> parameterValue(QParameterNamed01<T> parameter)
    Type Parameters:
      `T` - The parameter type
    Parameters:
      `parameter` - The parameter
    Returns:
      The value for the parameter, if one was provided

  - ### parameterValues

    <T> List<T> parameterValues(QParameterNamed1N<T> parameter)
    Type Parameters:
      `T` - The parameter type
    Parameters:
      `parameter` - The parameter
    Returns:
      The values for the parameter

  - ### parameterValues

    <T> List<T> parameterValues(QParameterNamed0N<T> parameter)
    Type Parameters:
      `T` - The parameter type
    Parameters:
      `parameter` - The parameter
    Returns:
      The values for the parameter

  - ### execute

    QCommandStatus execute() throws Exception
    Execute the command.
    Returns:
      The result of execution
    Throws:
      `Exception` - On errors

  - ### parameterValueRequireNow

    <T> T parameterValueRequireNow(QParameterNamed01<T> parameter) throws QException
    Type Parameters:
      `T` - The parameter type
    Parameters:
      `parameter` - The parameter
    Returns:
      The value for the parameter
    Throws:
      `QException` - On errors
    Since:
      1.4.0