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
-
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
-
ConsoleCommand
Constructor- Parameters:
consoleIO-state-
-
ConsoleCommand
public ConsoleCommand(ConsoleIO consoleIO, ConsoleState state, Map<String, ConsoleSetting> settings) Constructor- Parameters:
consoleIO- console IOstate- console statesettings- console settings
-
-
Method Details
-
getConsoleIO
-
getConsoleState
-
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.- Specified by:
executein interfaceCommand- Parameters:
parameters- parameters typed by user- Throws:
IOException- if a problem occurs reading or writing
-
write
-
writeln
-
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
-
writeUnopenedError
protected void writeUnopenedError()Write repository not opened error -
askProceed
Ask user to proceed- Parameters:
str- question to askdefVal- default value- Returns:
- true
-