|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crsh.command.impl.BaseCommandContext
org.crsh.command.impl.BaseInvocationContext<C,P>
public abstract class BaseInvocationContext<C,P>
| Field Summary | |
|---|---|
protected StringWriter |
buffer
. |
protected Iterable<C> |
consumedItems
. |
protected List<P> |
producedItems
. |
protected ShellPrinter |
writer
. |
| Constructor Summary | |
|---|---|
protected |
BaseInvocationContext(Iterable<C> consumedItems,
Map<String,Object> attributes)
|
| Method Summary | |
|---|---|
Iterable<C> |
consume()
Returns an iterator over the stream of consumed items. |
StringWriter |
getBuffer()
|
List<P> |
getProducedItems()
|
ShellPrinter |
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. |
| Methods inherited from class org.crsh.command.impl.BaseCommandContext |
|---|
getAttributes |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.crsh.command.InvocationContext |
|---|
getProperty, getWidth, readLine |
| Methods inherited from interface org.crsh.command.CommandContext |
|---|
getAttributes |
| Field Detail |
|---|
protected ShellPrinter writer
protected StringWriter buffer
protected List<P> producedItems
protected Iterable<C> consumedItems
| Constructor Detail |
|---|
protected BaseInvocationContext(Iterable<C> consumedItems,
Map<String,Object> attributes)
| Method Detail |
|---|
public List<P> getProducedItems()
public StringWriter getBuffer()
public boolean isPiped()
InvocationContext
isPiped in interface InvocationContext<C,P>public Iterable<C> consume()
InvocationContext
consume in interface InvocationContext<C,P>public void produce(P product)
InvocationContext
produce in interface InvocationContext<C,P>product - the item productpublic ShellPrinter getWriter()
InvocationContext
getWriter in interface InvocationContext<C,P>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||