Class Console
java.lang.Object
de.rexlcloud.core.console.Console
- All Implemented Interfaces:
Runnable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThrown byask(String, String, boolean, AnimationCompletion...)when the user cancels with Ctrl+C. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddConsoleAnimation(de.rexlcloud.core.console.animation.ConsoleAnimation animation) static Stringask(String question, @Nullable String defaultAnswer, boolean hidden, de.rexlcloud.core.console.animation.AnimationCompletion... completions) Asks a question and waits for the answer, for questions before the console reads commands (the first-start setup).static voidclear()static voidstatic voidstatic voidstatic voidList<de.rexlcloud.core.console.animation.AnimationCompletion> Completions of the questionask(String, String, boolean, AnimationCompletion...)is waiting for,nullotherwise.de.rexlcloud.core.console.CommandCompleterde.rexlcloud.core.command.CommandRegistryQueue<de.rexlcloud.core.console.animation.ConsoleAnimation> de.rexlcloud.core.console.LogListorg.jline.reader.LineReaderorg.jline.terminal.Terminalstatic voidstatic voidstatic voidinfoOnScreenOnly(String message, Object... placeholder) Shows an info line on the screen but keeps it out of the log files, e.g.booleanisDebug()booleanfalseonce "stop" was entered.voidrun()voidsetDebug()voidstatic voidstatic voidstatic voidstatic void
-
Constructor Details
-
Console
- Throws:
IOException
-
-
Method Details
-
setDebug
public void setDebug() -
addConsoleAnimation
public static void addConsoleAnimation(de.rexlcloud.core.console.animation.ConsoleAnimation animation) -
ask
public static String ask(String question, @Nullable @Nullable String defaultAnswer, boolean hidden, de.rexlcloud.core.console.animation.AnimationCompletion... completions) Asks a question and waits for the answer, for questions before the console reads commands (the first-start setup). The answer is not logged.- Parameters:
defaultAnswer- returned for an empty answer,nullfor none; shown unlesshiddenhidden- whether the input is masked, e.g. for passwordscompletions- offered with Tab- Returns:
- the answer, the default for an empty one, or
nullif there is no console input (e.g. stdin is closed); then the caller should use its defaults - Throws:
Console.AskCancelledException- when the user presses Ctrl+C
-
stopLogging
public void stopLogging() -
run
-
error
-
info
-
error
-
debug
-
debug
-
warn
-
warn
-
info
-
write
-
write
-
infoOnScreenOnly
-
clear
public static void clear() -
getCommandRegistry
public de.rexlcloud.core.command.CommandRegistry getCommandRegistry() -
getCommandCompleter
public de.rexlcloud.core.console.CommandCompleter getCommandCompleter() -
getTerminal
public org.jline.terminal.Terminal getTerminal() -
getReader
public org.jline.reader.LineReader getReader() -
isRunning
public boolean isRunning()falseonce "stop" was entered. Set from the start, so code that runs before the console thread does not see a stopped cloud. -
isDebug
public boolean isDebug() -
getFileWriter
-
getLogList
public de.rexlcloud.core.console.LogList getLogList() -
getConsoleAnimations
-
getAskCompletions
Completions of the questionask(String, String, boolean, AnimationCompletion...)is waiting for,nullotherwise.
-