Package sqlline
Interface CommandHandler
-
- All Known Implementing Classes:
AbstractCommandHandler
,ReflectiveCommandHandler
public interface CommandHandler
A generic command to be executed. Execution of the command should be dispatched to theexecute(String, DispatchCallback)
method after determining that the command is appropriate with thematches(String)
method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
execute(String line, DispatchCallback dispatchCallback)
Executes the specified command.String
getHelpText()
String
getName()
List<String>
getNames()
List<org.jline.reader.Completer>
getParameterCompleters()
Returns the completers that can handle parameters.String
matches(String line)
Checks to see if the specified string can be dispatched to this command.
-
-
-
Method Detail
-
getName
String getName()
- Returns:
- the name of the command
-
getHelpText
String getHelpText()
- Returns:
- the short help description for this command.
-
matches
String matches(String line)
Checks to see if the specified string can be dispatched to this command.- Parameters:
line
- The command line to check- Returns:
- the command string that matches, or null if it no match
-
execute
void execute(String line, DispatchCallback dispatchCallback)
Executes the specified command.- Parameters:
line
- The full command line to executedispatchCallback
- the callback to check or interrupt the action
-
getParameterCompleters
List<org.jline.reader.Completer> getParameterCompleters()
Returns the completers that can handle parameters.- Returns:
- Completers that can handle parameters
-
-