public class ClosureInvoker extends CommandInvoker<Object,Object>
Modifier and Type | Field and Description |
---|---|
private groovy.lang.Closure |
closure
.
|
private CommandContext<? super Object> |
consumer
.
|
private Class<?> |
type
.
|
Constructor and Description |
---|
ClosureInvoker(groovy.lang.Closure closure) |
Modifier and Type | Method and Description |
---|---|
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.
|
getKeyHandler, getScreenContext, invoke
private final groovy.lang.Closure closure
private CommandContext<? super Object> consumer
public ClosureInvoker(groovy.lang.Closure closure)
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 elementIOException
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 exceptionCopyright © 2015 eXo Platform SAS. All Rights Reserved.