|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cedarsoft.utils.AbstractCmdLine
com.cedarsoft.utils.StringCmdLine
public class StringCmdLine
Command Line implementation that is based on strings.
Date: 25.09.2006
| Constructor Summary | |
|---|---|
StringCmdLine()
|
|
| Method Summary | |
|---|---|
void |
addAnswer(java.lang.Object answer)
|
void |
addExpectedOut(java.lang.String expected)
|
void |
error(java.lang.String message,
java.lang.Object... objects)
Prints an error on the console |
java.util.List<java.lang.Object> |
getAnswers()
|
protected ConsolePrinter |
getConsolePrinter()
|
java.util.List<java.lang.String> |
getExpectedOut()
|
java.util.List<java.lang.String> |
getMessages()
|
protected java.lang.Object |
getNextAnswer()
|
java.io.PrintStream |
getOut()
|
void |
out(java.lang.Process process)
Redirect the output of the given process |
void |
out(java.lang.String message,
java.lang.Object... objects)
Prints a message |
void |
outNl()
Prints out a new line |
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 |
void |
removeAnswer(java.lang.Object answer)
|
void |
setAnswers(java.util.List<java.lang.Object> answers)
|
void |
success(java.lang.String message,
java.lang.Object... objects)
Prints a success message |
void |
warning(java.lang.String message,
java.lang.Object... objects)
Prints a warning |
| Methods inherited from class com.cedarsoft.utils.AbstractCmdLine |
|---|
printPossibleElements, read, read, read, readSelection, readSelection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.cedarsoft.utils.CmdLine |
|---|
read, read, read, readSelection, readSelection |
| Constructor Detail |
|---|
public StringCmdLine()
| Method Detail |
|---|
@NotNull public java.io.PrintStream getOut()
getOut in class AbstractCmdLine@NotNull protected ConsolePrinter getConsolePrinter()
getConsolePrinter in class AbstractCmdLine
public boolean readBoolean(@NotNull
java.lang.String message)
throws java.io.IOException
CmdLine
readBoolean in interface CmdLinemessage - the message that is shown
java.io.IOException
@NotNull
public java.lang.String read(@NotNull
java.lang.String message)
CmdLine
read in interface CmdLinemessage - the mssage
@NotNull public java.util.List<java.lang.String> getMessages()
protected java.lang.Object getNextAnswer()
@NotNull
public java.lang.String read(@NotNull
java.lang.String message,
@Nullable
java.lang.String defaultValue)
CmdLine
read in interface CmdLinemessage - the messagedefaultValue - the default value
public int readInt(@NotNull
java.lang.String message,
int lower,
int upper)
CmdLine
readInt in interface CmdLinemessage - the messagelower - the lower boundsupper - the upper bounds
public int readInt(@NotNull
java.lang.String message)
throws java.io.IOException
CmdLine
readInt in interface CmdLinemessage - the message
java.io.IOExceptionpublic void pause(int seconds)
CmdLine
pause in interface CmdLineseconds - the seconds that it is paused
public void out(@NotNull
java.lang.String message,
@NotNull
java.lang.Object... objects)
CmdLine
out in interface CmdLineout in class AbstractCmdLinemessage - the messageobjects - the objects
public void out(@NotNull
java.lang.Process process)
CmdLine
out in interface CmdLineout in class AbstractCmdLineprocess - the process the output for is redirected
public void error(@NotNull
java.lang.String message,
@NotNull
java.lang.Object... objects)
CmdLine
error in interface CmdLineerror in class AbstractCmdLinemessage - the error messageobjects - the objects
public void warning(@NotNull
java.lang.String message,
@NotNull
java.lang.Object... objects)
CmdLine
warning in interface CmdLinewarning in class AbstractCmdLinemessage - the messageobjects - the objects
public void success(@NotNull
java.lang.String message,
@NotNull
java.lang.Object... objects)
CmdLine
success in interface CmdLinesuccess in class AbstractCmdLinemessage - the messageobjects - the objectspublic void outNl()
CmdLine
outNl in interface CmdLineoutNl in class AbstractCmdLine
public void addExpectedOut(@Nullable
java.lang.String expected)
@NotNull public java.util.List<java.lang.String> getExpectedOut()
@NotNull public java.util.List<java.lang.Object> getAnswers()
public void setAnswers(@NotNull
java.util.List<java.lang.Object> answers)
public void addAnswer(@NotNull
java.lang.Object answer)
public void removeAnswer(@NotNull
java.lang.Object answer)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||