org.crsh.command.pipeline
Class ConvertingPipe<C,P,CONS extends CommandContext<? super P>>

java.lang.Object
  extended by org.crsh.command.pipeline.AbstractPipe<C,P,CONS>
      extended by org.crsh.command.pipeline.ConvertingPipe<C,P,CONS>
All Implemented Interfaces:
Closeable, Flushable, CommandContext<C>, RuntimeContext, Consumer<C>, Producer<P,CONS>, InteractionContext, ScreenContext

public class ConvertingPipe<C,P,CONS extends CommandContext<? super P>>
extends AbstractPipe<C,P,CONS>

Author:
Julien Viet

Field Summary
private  Class<C> consumedType
          .
private  Class<P> producedType
          .
 
Fields inherited from class org.crsh.command.pipeline.AbstractPipe
consumer, piped
 
Constructor Summary
ConvertingPipe(Class<C> consumedType, Class<P> producedType, boolean piped)
           
 
Method Summary
 Class<C> getConsumedType()
          Returns the class of the element generic type.
 Class<P> getProducedType()
          Returns the class of the produced type.
 void provide(C element)
          Provide an element.
 void write(Chunk chunk)
          Write a chunk to the screen.
 
Methods inherited from class org.crsh.command.pipeline.AbstractPipe
close, flush, getAttributes, getHeight, getProperty, getSession, getWidth, isPiped, open, readLine, releaseAlternateBuffer, takeAlternateBuffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

consumedType

private final Class<C> consumedType
.


producedType

private final Class<P> producedType
.

Constructor Detail

ConvertingPipe

public ConvertingPipe(Class<C> consumedType,
                      Class<P> producedType,
                      boolean piped)
Method Detail

getConsumedType

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

Returns:
the consumed type

getProducedType

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

Returns:
the produced type

write

public void write(Chunk chunk)
           throws IOException
Description copied from interface: ScreenContext
Write a chunk to the screen.

Parameters:
chunk - the chunk
Throws:
IOException - any io exception

provide

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

Parameters:
element - the provided element
Throws:
IOException


Copyright © 2013 eXo Platform SAS. All Rights Reserved.