Class CommandContext.DefaultCommandContext
java.lang.Object
org.springframework.shell.command.CommandContext.DefaultCommandContext
- All Implemented Interfaces:
CommandContext
- Enclosing interface:
- CommandContext
Default implementation of a
CommandContext
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.shell.command.CommandContext
CommandContext.DefaultCommandContext
-
Method Summary
Modifier and TypeMethodDescriptionGets a command registration.<T> T
getOptionValue
(String name) Gets an mapped option value.Gets a command option parser results.String[]
Gets a raw args passed into a currently executing command.Gets aShellContext
associated withCommandContext
.org.jline.terminal.Terminal
Gets a terminal.boolean
hasMappedOption
(String name) Gets if option has been mapped.
-
Method Details
-
getRawArgs
Description copied from interface:CommandContext
Gets a raw args passed into a currently executing command.- Specified by:
getRawArgs
in interfaceCommandContext
- Returns:
- raw command arguments
-
hasMappedOption
Description copied from interface:CommandContext
Gets if option has been mapped.- Specified by:
hasMappedOption
in interfaceCommandContext
- Parameters:
name
- the option name- Returns:
- true if option has been mapped, false otherwise
-
getParserResults
Description copied from interface:CommandContext
Gets a command option parser results.- Specified by:
getParserResults
in interfaceCommandContext
- Returns:
- the command option parser results
-
getCommandRegistration
Description copied from interface:CommandContext
Gets a command registration.- Specified by:
getCommandRegistration
in interfaceCommandContext
- Returns:
- the command registration
-
getOptionValue
Description copied from interface:CommandContext
Gets an mapped option value.- Specified by:
getOptionValue
in interfaceCommandContext
- Type Parameters:
T
- the type to map to- Parameters:
name
- the option name- Returns:
- mapped value
-
getTerminal
public org.jline.terminal.Terminal getTerminal()Description copied from interface:CommandContext
Gets a terminal.- Specified by:
getTerminal
in interfaceCommandContext
- Returns:
- a terminal
-
getShellContext
Description copied from interface:CommandContext
Gets aShellContext
associated withCommandContext
.- Specified by:
getShellContext
in interfaceCommandContext
- Returns:
- a shell context
-