Class ConsoleCommand
java.lang.Object
org.eclipse.rdf4j.console.command.ConsoleCommand
- Direct Known Subclasses:
Clear,Close,Connect,Convert,Create,Disconnect,Drop,Export,Federate,Load,Open,PrintHelp,PrintInfo,QueryEvaluator,SetParameters,Show,Verify
Abstract command
- Author:
- Bart Hanssens
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConsoleCommand(ConsoleIO consoleIO) ConstructorConsoleCommand(ConsoleIO consoleIO, ConsoleState state) ConstructorConsoleCommand(ConsoleIO consoleIO, ConsoleState state, Map<String, ConsoleSetting> settings) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaskProceed(String str, boolean defVal) Ask user to proceedvoidExecute the given parameters.Get console IOGet console settings mapGet console stateGet long descriptionGet short description, small enough to fit on one console rowString[]Return the names of the settings used.protected voidWrite a string to the consoleprotected voidwriteError(String str) Write a string + newline to the console and to the log as an errorprotected voidwriteError(String str, Exception e) Write a string + message of exception + newline to the console and to the log as an errorprotected voidWrite a string + newline to the console and to the log at level INFOprotected voidWrite a string + newline to the consoleprotected voidWrite repository not opened error
-
Field Details
-
LOGGER
protected final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
ConsoleCommand
Constructor- Parameters:
consoleIO-
-
ConsoleCommand
Constructor- Parameters:
consoleIO-state-
-
ConsoleCommand
Constructor- Parameters:
consoleIO- console IOstate- console statesettings- console settings
-
-
Method Details
-
getConsoleIO
Get console IO- Returns:
- console IO
-
getConsoleState
Get console state- Returns:
- console state
-
getConsoleSettings
Get console settings map- Returns:
- map of console settings
-
getHelpShort
Get short description, small enough to fit on one console row- Specified by:
getHelpShortin interfaceHelp- Returns:
- help string
-
getHelpLong
Get long description- Specified by:
getHelpLongin interfaceHelp- Returns:
- string, can be multiple lines
-
usesSettings
Description copied from interface:CommandReturn the names of the settings used.- Specified by:
usesSettingsin interfaceCommand- Returns:
- string array of settings
-
execute
Description copied from interface:CommandExecute the given parameters. -
write
Write a string to the console- Parameters:
str- text
-
writeln
Write a string + newline to the console- Parameters:
str- text
-
writeInfo
Write a string + newline to the console and to the log at level INFO- Parameters:
str- text
-
writeError
Write a string + newline to the console and to the log as an error- Parameters:
str- text
-
writeError
Write a string + message of exception + newline to the console and to the log as an error- Parameters:
str- texte- exception
-
writeUnopenedError
protected void writeUnopenedError()Write repository not opened error -
askProceed
Ask user to proceed- Parameters:
str- question to askdefVal- default value- Returns:
- true
-