org.crsh.lang.groovy.closure
Class ClosureInvoker

java.lang.Object
  extended by org.crsh.command.CommandInvoker<Object,Object>
      extended by org.crsh.lang.groovy.closure.ClosureInvoker
All Implemented Interfaces:
Closeable, Flushable, Consumer<Object>, Filter<Object,Object,CommandContext<? super Object>>, Producer<Object,CommandContext<? super Object>>

public class ClosureInvoker
extends CommandInvoker<Object,Object>

Author:
Julien Viet

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()
           
 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.command.CommandInvoker
invoke
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

closure

private final groovy.lang.Closure closure
.


type

private final Class<?> type
.


consumer

private CommandContext<? super Object> consumer
.

Constructor Detail

ClosureInvoker

public ClosureInvoker(groovy.lang.Closure closure)
Method Detail

getProducedType

public Class<Object> getProducedType()
Description copied from interface: Producer
Returns the class of the produced type.

Returns:
the produced type

getConsumedType

public Class<Object> getConsumedType()
Description copied from interface: Consumer
Returns the class of the element generic type.

Returns:
the consumed type

provide

public void provide(Object element)
             throws IOException
Description copied from interface: Consumer
Provide an element.

Parameters:
element - the provided element
Throws:
IOException

open

public void open(CommandContext<? super Object> consumer)
Description copied from interface: Producer
Open the producer with the specified consumer.

Parameters:
consumer - the consumer

flush

public void flush()
           throws IOException
Throws:
IOException

close

public void close()
Description copied from interface: Producer
Close the producer.



Copyright © 2013 eXo Platform SAS. All Rights Reserved.