com.cedarsoft.utils
Class DummyCmdLine

java.lang.Object
  extended by com.cedarsoft.utils.AbstractCmdLine
      extended by com.cedarsoft.utils.DummyCmdLine
All Implemented Interfaces:
CmdLine

public class DummyCmdLine
extends AbstractCmdLine

Author:
Johannes Schneider

Constructor Summary
DummyCmdLine()
           
DummyCmdLine(java.io.PrintStream out)
           
 
Method Summary
protected  ConsolePrinter getConsolePrinter()
           
 java.io.PrintStream getOut()
           
 void pause(int seconds)
          Pauses the script
 java.lang.String read(java.lang.String message)
          Reads a string form the console
 java.lang.String read(java.lang.String message, java.lang.String defaultValue)
          Reads a string from the console.
 boolean readBoolean(java.lang.String message)
          Reads a boolean from the command line
 int readInt(java.lang.String message)
          Reads an int from the console
 int readInt(java.lang.String message, int lower, int upper)
          Reads an int from the console
 
Methods inherited from class com.cedarsoft.utils.AbstractCmdLine
error, out, out, outNl, printPossibleElements, read, read, read, readSelection, readSelection, success, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyCmdLine

public DummyCmdLine()

DummyCmdLine

public DummyCmdLine(@NotNull
                    java.io.PrintStream out)
Method Detail

readBoolean

public boolean readBoolean(@NotNull
                           java.lang.String message)
                    throws java.io.IOException
Description copied from interface: CmdLine
Reads a boolean from the command line

Parameters:
message - the message that is shown
Returns:
the value the user has entered
Throws:
java.io.IOException

read

@NotNull
public java.lang.String read(@NotNull
                                     java.lang.String message)
Description copied from interface: CmdLine
Reads a string form the console

Parameters:
message - the mssage
Returns:
the string

read

@NotNull
public java.lang.String read(@NotNull
                                     java.lang.String message,
                                     @Nullable
                                     java.lang.String defaultValue)
Description copied from interface: CmdLine
Reads a string from the console. The user may optinally select the given default value

Parameters:
message - the message
defaultValue - the default value
Returns:
the string

readInt

public int readInt(@NotNull
                   java.lang.String message,
                   int lower,
                   int upper)
Description copied from interface: CmdLine
Reads an int from the console

Parameters:
message - the message
lower - the lower bounds
upper - the upper bounds
Returns:
the read int

readInt

public int readInt(@NotNull
                   java.lang.String message)
            throws java.io.IOException
Description copied from interface: CmdLine
Reads an int from the console

Parameters:
message - the message
Returns:
the int
Throws:
java.io.IOException

pause

public void pause(int seconds)
Description copied from interface: CmdLine
Pauses the script

Parameters:
seconds - the seconds that it is paused

getOut

@NotNull
public java.io.PrintStream getOut()
Specified by:
getOut in class AbstractCmdLine

getConsolePrinter

@NotNull
protected ConsolePrinter getConsolePrinter()
Specified by:
getConsolePrinter in class AbstractCmdLine


Copyright © 2009 cedarsoft GmbH. All Rights Reserved.