Interface InputHandler
-
- All Known Implementing Classes:
AbstractInputHandler,DefaultInputHandler,JLineInputHandler
public interface InputHandlerManage user input from different sources. TODO should this also echo any prompts before the input? TODO should this validate the input, reprompt if required? TODO readBoolean, readInt, readSingleChar - readLine's that parse the input- Author:
- Brett Porter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringreadLine()Read a single line of input, swalling the newline at the end.java.util.List<java.lang.String>readMultipleLines()Read a set of lines.java.lang.StringreadPassword()Read a single line of input, swalling the newline at the end.
-
-
-
Method Detail
-
readLine
java.lang.String readLine() throws java.io.IOExceptionRead a single line of input, swalling the newline at the end. If the input can be echoed, it will be.- Returns:
- the line read
- Throws:
java.io.IOException
-
readPassword
java.lang.String readPassword() throws java.io.IOExceptionRead a single line of input, swalling the newline at the end. This method guarantees input is not echoed.- Returns:
- the line read
- Throws:
java.io.IOException
-
readMultipleLines
java.util.List<java.lang.String> readMultipleLines() throws java.io.IOExceptionRead a set of lines. Equivalent to multiple calls toreadLine(). Ends when an empty line is encountered.- Returns:
- a list of lines read
- Throws:
java.io.IOException
-
-