Interface CommandParser

All Known Implementing Classes:
CommandParser.AstCommandParser

public interface CommandParser
Interface parsing arguments for a CommandRegistration. A command is always identified by a set of words like command subcommand1 subcommand2 and remaining part of it are options which this interface intercepts and translates into format we can understand.
  • Method Details

    • parse

      Parse options with a given arguments. May throw various runtime exceptions depending how parser is configure. For example if required option is missing an exception is thrown.
      Parameters:
      args - the arguments
      Returns:
      parsed results
    • of

      static CommandParser of(org.springframework.core.convert.ConversionService conversionService, Map<String,CommandRegistration> registrations, ParserConfig config)
      Gets an instance of a default command parser.
      Parameters:
      conversionService - the conversion service
      registrations - the command registrations
      config - the parser config
      Returns:
      instance of a default command parser