| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
LOGGER |
| Constructor and Description |
|---|
ConsoleCommand(ConsoleIO consoleIO)
Constructor
|
ConsoleCommand(ConsoleIO consoleIO,
ConsoleState state)
Constructor
|
ConsoleCommand(ConsoleIO consoleIO,
ConsoleState state,
Map<String,ConsoleSetting> settings)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
askProceed(String str,
boolean defVal)
Ask user to proceed
|
void |
execute(String... parameters)
Execute the given parameters.
|
ConsoleIO |
getConsoleIO()
Get console IO
|
Map<String,ConsoleSetting> |
getConsoleSettings()
Get console settings map
|
ConsoleState |
getConsoleState()
Get console state
|
String |
getHelpLong()
Get long description
|
String |
getHelpShort()
Get short description, small enough to fit on one console row
|
String[] |
usesSettings()
Return the names of the settings used.
|
protected void |
write(String str)
Write a string to the console
|
protected void |
writeError(String str)
Write a string + newline to the console and to the log as an error
|
protected void |
writeError(String str,
Exception e)
Write a string + message of exception + newline to the console and to the log as an error
|
protected void |
writeInfo(String str)
Write a string + newline to the console and to the log at level INFO
|
protected void |
writeln(String str)
Write a string + newline to the console
|
protected void |
writeUnopenedError()
Write repository not opened error
|
public ConsoleCommand(ConsoleIO consoleIO)
consoleIO - public ConsoleCommand(ConsoleIO consoleIO, ConsoleState state)
consoleIO - state - public ConsoleCommand(ConsoleIO consoleIO, ConsoleState state, Map<String,ConsoleSetting> settings)
consoleIO - console IOstate - console statesettings - console settingspublic ConsoleIO getConsoleIO()
public ConsoleState getConsoleState()
public Map<String,ConsoleSetting> getConsoleSettings()
public String getHelpShort()
getHelpShort in interface Helppublic String getHelpLong()
getHelpLong in interface Helppublic String[] usesSettings()
CommandusesSettings in interface Commandpublic void execute(String... parameters) throws IOException
Commandexecute in interface Commandparameters - parameters typed by userIOException - if a problem occurs reading or writingprotected void write(String str)
str - textprotected void writeln(String str)
str - textprotected void writeInfo(String str)
str - textprotected void writeError(String str)
str - textprotected void writeError(String str, Exception e)
str - texte - exceptionprotected void writeUnopenedError()
protected boolean askProceed(String str, boolean defVal)
str - question to askdefVal - default valueCopyright © 2015-2020 Eclipse Foundation. All Rights Reserved.