Class ConsoleCommand
- java.lang.Object
-
- org.eclipse.rdf4j.console.command.ConsoleCommand
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.LoggerLOGGER
-
Constructor Summary
Constructors Constructor Description ConsoleCommand(ConsoleIO consoleIO)ConstructorConsoleCommand(ConsoleIO consoleIO, ConsoleState state)ConstructorConsoleCommand(ConsoleIO consoleIO, ConsoleState state, Map<String,ConsoleSetting> settings)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaskProceed(String str, boolean defVal)Ask user to proceedvoidexecute(String... parameters)Execute the given parameters.ConsoleIOgetConsoleIO()Get console IOMap<String,ConsoleSetting>getConsoleSettings()Get console settings mapConsoleStategetConsoleState()Get console stateStringgetHelpLong()Get long descriptionStringgetHelpShort()Get short description, small enough to fit on one console rowString[]usesSettings()Return the names of the settings used.protected voidwrite(String str)Write 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 voidwriteInfo(String str)Write a string + newline to the console and to the log at level INFOprotected voidwriteln(String str)Write a string + newline to the consoleprotected voidwriteUnopenedError()Write repository not opened error
-
-
-
Constructor Detail
-
ConsoleCommand
public ConsoleCommand(ConsoleIO consoleIO)
Constructor- Parameters:
consoleIO-
-
ConsoleCommand
public ConsoleCommand(ConsoleIO consoleIO, ConsoleState state)
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 Detail
-
getConsoleIO
public ConsoleIO getConsoleIO()
Get console IO- Returns:
- console IO
-
getConsoleState
public ConsoleState getConsoleState()
Get console state- Returns:
- console state
-
getConsoleSettings
public Map<String,ConsoleSetting> getConsoleSettings()
Get console settings map- Returns:
- map of console settings
-
getHelpShort
public String getHelpShort()
Get short description, small enough to fit on one console row- Specified by:
getHelpShortin interfaceHelp- Returns:
- help string
-
getHelpLong
public String getHelpLong()
Get long description- Specified by:
getHelpLongin interfaceHelp- Returns:
- string, can be multiple lines
-
usesSettings
public String[] usesSettings()
Description copied from interface:CommandReturn the names of the settings used.- Specified by:
usesSettingsin interfaceCommand- Returns:
- string array of settings
-
execute
public void execute(String... parameters)
Description copied from interface:CommandExecute the given parameters.
-
write
protected void write(String str)
Write a string to the console- Parameters:
str- text
-
writeln
protected void writeln(String str)
Write a string + newline to the console- Parameters:
str- text
-
writeInfo
protected void writeInfo(String str)
Write a string + newline to the console and to the log at level INFO- Parameters:
str- text
-
writeError
protected void writeError(String str)
Write a string + newline to the console and to the log as an error- Parameters:
str- text
-
writeError
protected void writeError(String str, Exception e)
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
protected boolean askProceed(String str, boolean defVal)
Ask user to proceed- Parameters:
str- question to askdefVal- default value- Returns:
- true
-
-