View Javadoc
1   package org.cyclopsgroup.jmxterm.io;
2   
3   import java.io.IOException;
4   
5   /**
6    * An abstract class that provides command line input line by line
7    * 
8    * @author <a href="mailto:jiaqi.guo@gmail.com">Jiaqi Guo</a>
9    */
10  public abstract class CommandInput {
11    /**
12     * Closes and releases relevant resources.
13     */
14    public void close() throws IOException {}
15  
16    /**
17     * Reads a single line from linput.
18     */
19    public abstract String readLine() throws IOException;
20  
21    /**
22     * Reads input without echo'ing back keyboard input.
23     */
24    public abstract String readMaskedString(String prompt) throws IOException;
25  }