Class RequestContext


  • public class RequestContext
    extends Object
    Request context class contains information about the request. This object is passed to sub command handler which services the request.
    • Constructor Detail

      • RequestContext

        public RequestContext​(CLIRequest request,
                              CommandManager commandMgr,
                              SubCommand subcmd)
                       throws CLIException
        Creates a request context object.
        Parameters:
        request - Request object.
        commandMgr - Command Manager object.
        subcmd - Sub Command object.
        Throws:
        CLIException - if this object cannot be constructed.
    • Method Detail

      • getCommandManager

        public CommandManager getCommandManager()
        Returns the CommandManager object.
        Returns:
        the CommandManager object.
      • getCLIRequest

        public CLIRequest getCLIRequest()
        Returns CLI Request object.
        Returns:
        CLI Request object.
      • getSubCommand

        public SubCommand getSubCommand()
        Returns sub command object.
        Returns:
        sub command object.
      • getResourceString

        public String getResourceString​(String key)
        Returns resource string.
        Parameters:
        key - Key of resource string.
        Returns:
        resource string.
      • getOption

        public List getOption​(String name)
        Returns values of an argument/option.
        Returns:
        values of an argument/option.
      • getOptions

        public Map getOptions()
        Returns a map of argument/option to its values (List).
        Returns:
        a map of argument/option to its values.