|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crsh.command.pipeline.PipeLineElement<C,P>
class PipeLineElement<C,P>
| Field Summary | |
|---|---|
(package private) Filter<C,P,CommandContext<P>> |
command
. |
(package private) Class<C> |
consumedType
. |
protected CommandContext<P> |
context
. |
| Constructor Summary | |
|---|---|
PipeLineElement(Filter<C,P,CommandContext<P>> command)
|
|
| Method Summary | |
|---|---|
void |
close()
Close the producer. |
void |
flush()
|
Map<String,Object> |
getAttributes()
Returns the current attributes. |
Class<C> |
getConsumedType()
Returns the class of the element generic 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. |
Map<String,Object> |
getSession()
Returns the current session. |
int |
getWidth()
Returns the screen width in chars. |
boolean |
isPiped()
|
void |
open(CommandContext<P> consumer)
Open the producer with the specified consumer. |
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. |
boolean |
takeAlternateBuffer()
Take control of the alternate buffer. |
void |
write(Chunk chunk)
Write a chunk to the screen. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected CommandContext<P> context
final Filter<C,P,CommandContext<P>> command
final Class<C> consumedType
| Constructor Detail |
|---|
PipeLineElement(Filter<C,P,CommandContext<P>> command)
| Method Detail |
|---|
public final boolean takeAlternateBuffer()
throws IOException
InteractionContextFlushable.flush() method
is invoked.
takeAlternateBuffer in interface InteractionContextIOException
public final boolean releaseAlternateBuffer()
throws IOException
InteractionContextFlushable.flush() method
is invoked.
releaseAlternateBuffer in interface InteractionContextIOExceptionpublic final String getProperty(String propertyName)
InteractionContext
getProperty in interface InteractionContextpropertyName - the property name
public final String readLine(String msg,
boolean echo)
InteractionContext
readLine in interface InteractionContextmsg - the message to display before reading a lineecho - wether or not the line read should be echoed when typing
public final int getWidth()
ScreenContext
getWidth in interface ScreenContextpublic final int getHeight()
ScreenContext
getHeight in interface ScreenContextpublic Map<String,Object> getSession()
RuntimeContext
getSession in interface RuntimeContextpublic Map<String,Object> getAttributes()
RuntimeContext
getAttributes in interface RuntimeContextpublic boolean isPiped()
isPiped in interface CommandContext<C>public Class<P> getProducedType()
Producer
getProducedType in interface Producer<P,CommandContext<P>>public Class<C> getConsumedType()
Consumer
getConsumedType in interface Consumer<C>public void open(CommandContext<P> consumer)
Producer
open in interface Producer<P,CommandContext<P>>consumer - the consumer
public void write(Chunk chunk)
throws IOException
ScreenContext
write in interface ScreenContextchunk - the chunk
IOException - any io exception
public void provide(C element)
throws IOException
Consumer
provide in interface Consumer<C>element - the provided element
IOException
public void flush()
throws IOException
flush in interface FlushableIOException
public void close()
throws ScriptException,
IOException
Producer
close in interface Closeableclose in interface Producer<P,CommandContext<P>>IOException - any io exception
ScriptException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||