org.sonatype.gshell.util.io
Class PromptReader

java.lang.Object
  extended by org.sonatype.gshell.util.io.PromptReader

public class PromptReader
extends Object

Helper to prompt a user for information.

Since:
2.3
Author:
Jason Dillon

Nested Class Summary
static interface PromptReader.Validator
          Allows caller to customize the validation behavior when prompting.
 
Constructor Summary
PromptReader(StreamSet streams, jline.Terminal term)
           
 
Method Summary
protected  jline.console.ConsoleReader createReader(StreamSet streams, jline.Terminal term)
           
 char getMask()
           
 String readLine(String prompt)
           
 String readLine(String prompt, char mask)
           
 String readLine(String prompt, char mask, PromptReader.Validator validator)
           
 String readLine(String prompt, PromptReader.Validator validator)
           
 String readPassword(String prompt)
           
 String readPassword(String prompt, PromptReader.Validator validator)
           
 void setMask(char mask)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PromptReader

public PromptReader(StreamSet streams,
                    jline.Terminal term)
             throws IOException
Throws:
IOException
Method Detail

createReader

protected jline.console.ConsoleReader createReader(StreamSet streams,
                                                   jline.Terminal term)
                                            throws IOException
Throws:
IOException

getMask

public char getMask()

setMask

public void setMask(char mask)

readLine

public String readLine(String prompt,
                       PromptReader.Validator validator)
                throws IOException
Throws:
IOException

readLine

public String readLine(String prompt)
                throws IOException
Throws:
IOException

readLine

public String readLine(String prompt,
                       char mask,
                       PromptReader.Validator validator)
                throws IOException
Throws:
IOException

readLine

public String readLine(String prompt,
                       char mask)
                throws IOException
Throws:
IOException

readPassword

public String readPassword(String prompt,
                           PromptReader.Validator validator)
                    throws IOException
Throws:
IOException

readPassword

public String readPassword(String prompt)
                    throws IOException
Throws:
IOException


Copyright © 2008-2011 Sonatype. All Rights Reserved.