Annotation Type Argument


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

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String value
      Argument name
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String defaultValue
      Get the default value
      java.lang.String description
      The argument description
      java.lang.String parserName
      Name of the argument parser
      java.lang.String suggestions
      Name of the suggestions provider to use.
    • Element Detail

      • value

        java.lang.String value
        Argument name
        Returns:
        Argument name
      • parserName

        java.lang.String parserName
        Name of the argument parser
        Returns:
        Argument name
        Default:
        ""
      • suggestions

        java.lang.String suggestions
        Name of the suggestions 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, BiFunction). The registry instance can be retrieved using CommandManager.getParserRegistry().

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

        java.lang.String defaultValue
        Get the default value
        Returns:
        Default value
        Default:
        ""
      • description

        java.lang.String description
        The argument description
        Returns:
        Argument description
        Default:
        ""