|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.crsh.shell.impl.command.spi.CommandInvoker<Object,Object> org.crsh.lang.impl.groovy.closure.ClosureInvoker
public class ClosureInvoker
Field Summary | |
---|---|
private groovy.lang.Closure |
closure
. |
private CommandContext<? super Object> |
consumer
. |
private Class<?> |
type
. |
Constructor Summary | |
---|---|
ClosureInvoker(groovy.lang.Closure closure)
|
Method Summary | |
---|---|
void |
close()
Close the producer. |
void |
flush()
Flush the stream. |
Class<Object> |
getConsumedType()
Returns the class of the element generic type. |
Class<Object> |
getProducedType()
Returns the class of the produced type. |
void |
open(CommandContext<? super Object> consumer)
Open the producer with the specified consumer. |
void |
provide(Object element)
Provide an element. |
Methods inherited from class org.crsh.shell.impl.command.spi.CommandInvoker |
---|
getKeyHandler, getScreenContext, invoke |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final groovy.lang.Closure closure
private final Class<?> type
private CommandContext<? super Object> consumer
Constructor Detail |
---|
public ClosureInvoker(groovy.lang.Closure closure)
Method Detail |
---|
public Class<Object> getProducedType()
Producer
public Class<Object> getConsumedType()
Consumer
public void provide(Object element) throws IOException, CommandException
Consumer
provide
in interface Consumer<Object>
provide
in class CommandInvoker<Object,Object>
element
- the provided element
IOException
CommandException
public void open(CommandContext<? super Object> consumer)
Producer
open
in interface Producer<Object,CommandContext<? super Object>>
open
in class CommandInvoker<Object,Object>
consumer
- the consumerpublic void flush() throws IOException
Consumer
flush
in interface Consumer<Object>
flush
in class CommandInvoker<Object,Object>
IOException
- any io exceptionpublic void close()
Producer
close
in interface Producer<Object,CommandContext<? super Object>>
close
in class CommandInvoker<Object,Object>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |