|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cedarsoft.utils.AbstractCmdLine
public abstract class AbstractCmdLine
Base class that delegates all methods to the a few core methods.
| Constructor Summary | |
|---|---|
AbstractCmdLine()
|
|
| Method Summary | ||
|---|---|---|
void |
error(java.lang.String message,
java.lang.Object... objects)
Prints an error on the console |
|
protected abstract ConsolePrinter |
getConsolePrinter()
|
|
abstract 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 |
|
protected
|
printPossibleElements(java.util.List<? extends T> elements,
Renderer<? super T,java.lang.Object> presenter)
|
|
|
read(java.lang.String message,
java.util.List<? extends T> elements,
Renderer<T,java.lang.Object> presenter,
ObjectFactory<T> objectFactory)
Reads a string from the console |
|
java.lang.String |
read(java.lang.String message,
java.util.List<java.lang.String> elements)
Reads a string |
|
java.lang.String |
read(java.lang.String message,
java.util.List<java.lang.String> elements,
java.lang.String preselected)
Reads a string from the console |
|
|
readSelection(java.lang.String message,
java.util.List<? extends T> elements)
Selects an element |
|
|
readSelection(java.lang.String message,
java.util.List<? extends T> elements,
Renderer<? super T,java.lang.Object> presenter)
Select an element from the list |
|
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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.cedarsoft.utils.CmdLine |
|---|
pause, read, read, readBoolean, readInt, readInt |
| Constructor Detail |
|---|
public AbstractCmdLine()
| Method Detail |
|---|
public void warning(@NotNull
java.lang.String message,
@NotNull
java.lang.Object... objects)
CmdLine
warning in interface CmdLinemessage - the messageobjects - the objects
public void error(@NotNull
java.lang.String message,
@NotNull
java.lang.Object... objects)
CmdLine
error in interface CmdLinemessage - the error messageobjects - the objects
public void success(@NotNull
java.lang.String message,
@NotNull
java.lang.Object... objects)
CmdLine
success in interface CmdLinemessage - the messageobjects - the objectspublic void outNl()
CmdLine
outNl in interface CmdLine
public void out(@NotNull
java.lang.String message,
@NotNull
java.lang.Object... objects)
CmdLine
out in interface CmdLinemessage - the messageobjects - the objects
public void out(@NotNull
java.lang.Process process)
CmdLine
out in interface CmdLineprocess - the process the output for is redirected
@NotNull
public <T> T readSelection(@NotNull
java.lang.String message,
@NotNull
java.util.List<? extends T> elements)
CmdLine
readSelection in interface CmdLinemessage - the messageelements - the elements
protected <T> void printPossibleElements(@NotNull
java.util.List<? extends T> elements,
@Nullable
Renderer<? super T,java.lang.Object> presenter)
@NotNull
public <T> T readSelection(@NotNull
java.lang.String message,
@NotNull
java.util.List<? extends T> elements,
@Nullable
Renderer<? super T,java.lang.Object> presenter)
CmdLine
readSelection in interface CmdLinemessage - the messageelements - the elements that may be choosen @return the selected elementpresenter - an optional presenter that creates a string representation for the elements
@NotNull
public java.lang.String read(@NotNull
java.lang.String message,
@NotNull
java.util.List<java.lang.String> elements)
CmdLine
read in interface CmdLinemessage - the messageelements - the elements that may be selected
@NotNull
public java.lang.String read(@NotNull
java.lang.String message,
@NotNull
java.util.List<java.lang.String> elements,
@NotNull
java.lang.String preselected)
CmdLine
read in interface CmdLinemessage - the messageelements - the elementspreselected - the preselected string
@NotNull
public <T> T read(@NotNull
java.lang.String message,
@NotNull
java.util.List<? extends T> elements,
@Nullable
Renderer<T,java.lang.Object> presenter,
@NotNull
ObjectFactory<T> objectFactory)
CmdLine
read in interface CmdLinemessage - the messageelements - the elements (the user may select one of them)presenter - the presenter
@NotNull public abstract java.io.PrintStream getOut()
@NotNull protected abstract ConsolePrinter getConsolePrinter()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||