Interface ArgumentParser<C,​T>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_ARGUMENT_COUNT
      Default amount of arguments that the parser expects to consume
    • Method Summary

      Modifier and Type Method Description
      default int getRequestedArgumentCount()
      Get the amount of arguments that this parsers seeks to consume
      default boolean isContextFree()
      Check whether or not this argument parser is context free.
      @NonNull ArgumentParseResult<@NonNull T> parse​(@NonNull CommandContext<@NonNull C> commandContext, @NonNull java.util.Queue<@NonNull java.lang.String> inputQueue)
      Parse command input into a command result
      default @NonNull java.util.List<@NonNull java.lang.String> suggestions​(@NonNull CommandContext<C> commandContext, @NonNull java.lang.String input)
      Get a list of suggested arguments that would be correctly parsed by this parser
    • Field Detail

      • DEFAULT_ARGUMENT_COUNT

        static final int DEFAULT_ARGUMENT_COUNT
        Default amount of arguments that the parser expects to consume
        See Also:
        Constant Field Values
    • Method Detail

      • parse

        @NonNull ArgumentParseResult<@NonNull T> parse​(@NonNull CommandContext<@NonNull C> commandContext,
                                                       @NonNull java.util.Queue<@NonNull java.lang.String> inputQueue)
        Parse command input into a command result
        Parameters:
        commandContext - Command context
        inputQueue - The queue of arguments
        Returns:
        Parsed command result
      • suggestions

        default @NonNull java.util.List<@NonNull java.lang.String> suggestions​(@NonNull CommandContext<C> commandContext,
                                                                               @NonNull java.lang.String input)
        Get a list of suggested arguments that would be correctly parsed by this parser
        Parameters:
        commandContext - Command context
        input - Input string
        Returns:
        List of suggestions
      • isContextFree

        default boolean isContextFree()
        Check whether or not this argument parser is context free. A context free parser will not use the provided command context, and so supports impromptu parsing
        Returns:
        true if the parser is context free, else false
      • getRequestedArgumentCount

        default int getRequestedArgumentCount()
        Get the amount of arguments that this parsers seeks to consume
        Returns:
        The number of arguments tha the parser expects
        Since:
        1.1.0