Annotation Type Argument


@Retention(RUNTIME) @Target(PARAMETER) public @interface Argument
Annotation used to indicate that a method parameter is a command argument.

This annotation is optional if the parameter names are preserved during compilation, and the parameter name matches the corresponding syntax fragment.

  • Element Details

    • value

      The name of the argument that this parameter is bound to. This value must be overridden unless you have explicitly enabled the preservation of parameter names in your compiler options.

      If the parameter names are preserved and the name of the bound argument is the same as the parameter name, the default value may be used. The mapping between parameter names and argument names can be overridden by supplying a custom ParameterNameExtractor to a StandardArgumentExtractor.

      Returns:
      Argument name
      Default:
      "__INFERRED_ARGUMENT_NAME__"
    • parserName

      @NonNull String parserName
      Name of the argument parser
      Returns:
      Argument name
      Default:
      ""
    • suggestions

      @NonNull String suggestions
      Name of the suggestion provider to use. If the string is left empty, the default provider for the argument parser will be used. Otherwise, the ParserRegistry instance in the CommandManager will be queried for a matching suggestion provider.

      For this to work, the suggestion needs to be registered in the parser registry. To do this, use ParserRegistry.registerSuggestionProvider(String, SuggestionProvider). The registry instance can be retrieved using CommandManager.parserRegistry().

      Returns:
      The name of the suggestion provider, or "" if the default suggestion provider for the argument parser should be used instead
      Default:
      ""
    • description

      @NonNull String description
      The argument description
      Returns:
      Argument description
      Default:
      ""