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
-
Constructor Summary
ConstructorDescriptionConsoleCommand
(ConsoleIO consoleIO) ConstructorConsoleCommand
(ConsoleIO consoleIO, ConsoleState state) ConstructorConsoleCommand
(ConsoleIO consoleIO, ConsoleState state, Map<String, ConsoleSetting> settings) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
askProceed
(String str, boolean defVal) Ask user to proceedvoid
Execute 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 void
Write a string to the consoleprotected void
writeError
(String str) Write a string + newline to the console and to the log as an errorprotected void
writeError
(String str, Exception e) Write a string + message of exception + newline to the console and to the log as an errorprotected void
Write a string + newline to the console and to the log at level INFOprotected void
Write a string + newline to the consoleprotected void
Write 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:
getHelpShort
in interfaceHelp
- Returns:
- help string
-
getHelpLong
Get long description- Specified by:
getHelpLong
in interfaceHelp
- Returns:
- string, can be multiple lines
-
usesSettings
Description copied from interface:Command
Return the names of the settings used.- Specified by:
usesSettings
in interfaceCommand
- Returns:
- string array of settings
-
execute
Description copied from interface:Command
Execute 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
-