|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface InvocationContext<C,P>
The invocation context provided to a command during the invocation phase. The invocation context provides the various interactions that a command can perform with its context during its invocation.
Method Summary | |
---|---|
Iterable<C> |
consume()
Returns an iterator over the stream of consumed items. |
String |
getProperty(String propertyName)
Returns a generic property. |
int |
getWidth()
Returns the term width in chars. |
PrintWriter |
getWriter()
Returns the writer for the output. |
boolean |
isPiped()
Returns true if the command is involved in a pipe operation and receives a stream. |
void |
produce(P product)
Produce an item. |
String |
readLine(String msg,
boolean echo)
Display a message and read a line on the console. |
Methods inherited from interface org.crsh.command.CommandContext |
---|
getAttributes |
Method Detail |
---|
int getWidth()
String getProperty(String propertyName)
propertyName
- the property name
String readLine(String msg, boolean echo)
msg
- the message to display before reading a lineecho
- wether or not the line read should be echoed when typing
PrintWriter getWriter()
boolean isPiped()
Iterable<C> consume() throws IllegalStateException
IllegalStateException
- if the command is not involved in a pipe operationvoid produce(P product)
product
- the item product
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |