Interface ArgumentParser<C,​T>

    • Method Summary

      Modifier and Type Method Description
      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
    • 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