org.specrunner.core.pipes
Class PipePopulator

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

public class PipePopulator
extends Object
implements IPipe

Add extra information to the given context.

Author:
Thiago Santos

Constructor Summary
PipePopulator()
           
 
Method Summary
 boolean check(IChannel channel)
          Check if a pipe must perform something on channel.
protected  IContext populate(IContext context)
          Populate a context with predefined values.
 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
 

Constructor Detail

PipePopulator

public PipePopulator()
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.

populate

protected IContext populate(IContext context)
                     throws ContextException
Populate a context with predefined values.

Parameters:
context - The context to be populated.
Returns:
The context populated.
Throws:
ContextException - On populate errors.


Copyright © 2014. All rights reserved.