Package org.strassburger.tui4j.input
Class TextInput
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.strassburger.tui4j.input.Input
addValidationRule, addValidationRules, getCursor, getErrorMessage, getLabel, getPrinter, getScanner, isRetryOnInvalid, setCursor, setErrorMessage, setErrorMessage, setLabel, setLabel, setPrinter, setRetryOnInvalid, setScanner, validate
-
Constructor Details
-
TextInput
public TextInput()Reads a single line of text from the console.
Example usage:
String name = new TextInput() .setLabel("What is your name?") .setRetryOnInvalid(true) .read();
-
-
Method Details
-
read
Description copied from class:InputRead the input value- Specified by:
readin classInput<String,TextInput> - Returns:
- the input value
- Throws:
InputValidationException- if the input is invalid and retryOnInvalid is false
-
setInline
Set whether the input should be inline or not.- Parameters:
inline- Whether the input should be inline or not
-