org.specrunner.core.pipes
Class PipeResult

java.lang.Object
  extended by org.specrunner.core.pipes.PipeResult
All Implemented Interfaces:
IPipe

public class PipeResult
extends Object
implements IPipe

Bind a result to the channel.

Author:
Thiago Santos

Field Summary
static String RESULT
          Source.
 
Constructor Summary
PipeResult()
           
 
Method Summary
static void bind(IChannel channel, IResultSet result)
          Bind the result set to the channel.
 boolean check(IChannel channel)
          Check if a pipe must perform something on channel.
protected  IResultSet createResult()
          Create a result instance.
static IResultSet lookup(IChannel channel)
          Recover the result set from channel.
 IChannel process(IChannel channel)
          Perform some transformation over the channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESULT

public static final String RESULT
Source.

See Also:
Constant Field Values
Constructor Detail

PipeResult

public PipeResult()
Method Detail

check

public boolean check(IChannel channel)
              throws AbortException
Description copied from interface: IPipe
Check if a pipe must perform something on channel. If the channel is corrupted the pipe must throw AbortException.

Specified by:
check in interface IPipe
Parameters:
channel - The information channel.
Returns:
true, if pipe must perform something on channel, false, otherwise.
Throws:
AbortException - If the channel is corrupted.

process

public IChannel process(IChannel channel)
                 throws PipelineException
Description copied from interface: IPipe
Perform some transformation over the channel.

Specified by:
process in interface IPipe
Parameters:
channel - The channel.
Returns:
The pipe itself.
Throws:
PipelineException - On processing errors.

createResult

protected IResultSet createResult()
Create a result instance.

Returns:
A result set.

bind

public static void bind(IChannel channel,
                        IResultSet result)
Bind the result set to the channel.

Parameters:
channel - The channel.
result - The result set.

lookup

public static IResultSet lookup(IChannel channel)
                         throws NotFoundException,
                                InvalidTypeException
Recover the result set from channel.

Parameters:
channel - The channel.
Returns:
The result set.
Throws:
NotFoundException - On lookup errors.
InvalidTypeException - On type errors.


Copyright © 2014. All rights reserved.