|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crsh.shell.impl.command.InvokerPipeFilter<C,P>
class InvokerPipeFilter<C,P>
A pipe filter that invokes a command through a CommandInvoker.
| Field Summary | |
|---|---|
(package private) ProducerConsumer<C,P> |
command
. |
private ProducerContext<P> |
context
. |
| Constructor Summary | |
|---|---|
InvokerPipeFilter(ProducerConsumer<C,P> command)
|
|
| Method Summary | |
|---|---|
void |
close()
Close the producer. |
void |
flush()
|
Class<C> |
getConsumedType()
Returns the class of the consumed type. |
int |
getHeight()
Returns the screen height in chars. |
Class<P> |
getProducedType()
Returns the class of the produced type. |
String |
getProperty(String propertyName)
Returns a generic property, usually this property is resolved by the shell client. |
int |
getWidth()
Returns the screen width in chars. |
void |
invoke(InvocationContext<P> context)
|
void |
open(ProducerContext<P> context)
Open the producer with the specified context. |
void |
provide(C element)
Provide an element. |
String |
readLine(String msg,
boolean echo)
Display a message and read a line on the console. |
boolean |
releaseAlternateBuffer()
Release control of the alternate buffer. |
void |
setPiped(boolean piped)
Set the pipe status. |
boolean |
takeAlternateBuffer()
Take control of the alternate buffer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
final ProducerConsumer<C,P> command
private ProducerContext<P> context
| Constructor Detail |
|---|
InvokerPipeFilter(ProducerConsumer<C,P> command)
| Method Detail |
|---|
public void invoke(InvocationContext<P> context)
throws ScriptException,
IOException
ScriptException
IOExceptionpublic void setPiped(boolean piped)
Producer
setPiped in interface Producer<P>piped - the piped statuspublic Class<P> getProducedType()
Producer
getProducedType in interface Producer<P>public Class<C> getConsumedType()
Consumer
getConsumedType in interface Consumer<C>public boolean takeAlternateBuffer()
InteractionContextFlushable.flush() method
is invoked.
takeAlternateBuffer in interface InteractionContext<C>public boolean releaseAlternateBuffer()
InteractionContextFlushable.flush() method
is invoked.
releaseAlternateBuffer in interface InteractionContext<C>public String getProperty(String propertyName)
InteractionContext
getProperty in interface InteractionContext<C>propertyName - the property name
public String readLine(String msg,
boolean echo)
InteractionContext
readLine in interface InteractionContext<C>msg - the message to display before reading a lineecho - wether or not the line read should be echoed when typing
public int getWidth()
ScreenContext
getWidth in interface ScreenContext<C>public int getHeight()
ScreenContext
getHeight in interface ScreenContext<C>public void open(ProducerContext<P> context)
Producer
open in interface Producer<P>context - the context
public void provide(C element)
throws IOException
Pipe
provide in interface Pipe<C>element - the provided element
IOException
public void flush()
throws IOException
flush in interface FlushableIOException
public void close()
throws ScriptException
Producer
close in interface Closeableclose in interface Producer<P>ScriptException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||