public class ConsoleTextTerminal extends AbstractTextTerminal<ConsoleTextTerminal>
TextTerminal
backed by a Console
.DEFAULT_USER_INTERRUPT_KEY, SYSPROP_PROPERTIES_FILE_LOCATION
Constructor and Description |
---|
ConsoleTextTerminal() |
ConsoleTextTerminal(java.io.Console console) |
Modifier and Type | Method and Description |
---|---|
void |
println()
Terminates the current line by writing the line separator string.
|
void |
rawPrint(java.lang.String message)
Prints the message in its raw form.
|
java.lang.String |
read(boolean masking)
Reads a line of text
|
boolean |
registerUserInterruptHandler(java.util.function.Consumer<ConsoleTextTerminal> handler,
boolean abortRead)
Registers a handler that will be called in response to a user interrupt.
|
addDefaultProperty, getDefaultProperties, getProperties, getPropertiesPrefixes, getPropertiesReader, init, initProperties, initProperties, initProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
abort, dispose, dispose, print, print, printf, printf, println, println, rawPrint, resetLine, resetToBookmark, setBookmark
public ConsoleTextTerminal()
public ConsoleTextTerminal(java.io.Console console)
public java.lang.String read(boolean masking)
TextTerminal
masking
- true, if the input should be masked (for example to enter a password)public void rawPrint(java.lang.String message)
TextTerminal
public void println()
TextTerminal
public boolean registerUserInterruptHandler(java.util.function.Consumer<ConsoleTextTerminal> handler, boolean abortRead)
TextTerminal
handler
- the action to be performed in response to a user interrupt.abortRead
- true, if the current read operation should be aborted on user interrupt.