org.basex.util
Class ConsoleReader

java.lang.Object
  extended by org.basex.util.ConsoleReader

public abstract class ConsoleReader
extends java.lang.Object

Console reader.

Author:
BaseX Team 2005-12, BSD License, Dimitar Popov

Field Summary
protected static java.lang.String PASSWORD_PROMPT
          Password prompt.
 
Constructor Summary
ConsoleReader()
           
 
Method Summary
static ConsoleReader newInstance()
          Creates a new instance.
 PasswordReader pwReader()
          Create a new password reader for this console.
abstract  java.lang.String readLine()
          Reads next line.
abstract  java.lang.String readPassword()
          Reads a password.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PASSWORD_PROMPT

protected static final java.lang.String PASSWORD_PROMPT
Password prompt.

Constructor Detail

ConsoleReader

public ConsoleReader()
Method Detail

readLine

public abstract java.lang.String readLine()
Reads next line. If no input, then the method blocks the thread.

Returns:
next line or null if EOF is reached

readPassword

public abstract java.lang.String readPassword()
Reads a password.

Returns:
password as plain text

pwReader

public PasswordReader pwReader()
Create a new password reader for this console.

Returns:
a new instance of PasswordReader

newInstance

public static final ConsoleReader newInstance()
Creates a new instance.

Returns:
instance of console reader