org.specrunner.plugins.core
Class PluginGroupImpl

java.lang.Object
  extended by org.specrunner.util.composite.core.CompositeImpl<IPluginGroup,IPlugin>
      extended by org.specrunner.plugins.core.PluginGroupImpl
All Implemented Interfaces:
IParameterHolder, IActionType, IPlugin, IPluginGroup, IComposite<IPluginGroup,IPlugin>

public class PluginGroupImpl
extends CompositeImpl<IPluginGroup,IPlugin>
implements IPluginGroup

Default plugin group implementation.

Author:
Thiago Santos

Constructor Summary
PluginGroupImpl()
          Default constructor.
 
Method Summary
 IPluginGroup add(IPlugin child)
          Adds a child plugin.
 IPlugin copy(IContext context)
          Creates a copy of this plugin.
 void doEnd(IContext context, IResultSet result)
          The end action. i.e. after a loop specification perform something in a newly generated table.
 ENext doStart(IContext context, IResultSet result)
          Performs the start action. i.e. create a database schema.
 ActionType getActionType()
          Get the plugin type.
 IPlugin getNormalized()
          Returns the normalized version of the group.
 IParameterDecorator getParameters()
          Get parameters.
 IPluginFactory getParent()
          Get the plugin factory source.
 void initialize(IContext context)
          Initialize the plugin.
 void setParameters(IParameterDecorator parameters)
          Set the parameters.
 void setParent(IPluginFactory parent)
          Set the plugin factory (where it came from).
 String toString()
           
 
Methods inherited from class org.specrunner.util.composite.core.CompositeImpl
getChildren, isEmpty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.specrunner.util.composite.IComposite
getChildren, isEmpty
 

Constructor Detail

PluginGroupImpl

public PluginGroupImpl()
Default constructor.

Method Detail

getParent

public IPluginFactory getParent()
Description copied from interface: IPlugin
Get the plugin factory source.

Specified by:
getParent in interface IPlugin
Returns:
The plugin.

setParent

public void setParent(IPluginFactory parent)
Description copied from interface: IPlugin
Set the plugin factory (where it came from).

Specified by:
setParent in interface IPlugin
Parameters:
parent - The factory.

add

public IPluginGroup add(IPlugin child)
Adds a child plugin. No repetition is allowed.

Specified by:
add in interface IComposite<IPluginGroup,IPlugin>
Overrides:
add in class CompositeImpl<IPluginGroup,IPlugin>
Parameters:
child - The child plugin.
Returns:
The group itself.

getNormalized

public IPlugin getNormalized()
Returns the normalized version of the group. In case of empty group a singleton instance of PluginNop is returned, and in case of single member group the member is returned.

Specified by:
getNormalized in interface IPluginGroup
Returns:
The normalized version of the plugin.

getActionType

public ActionType getActionType()
Description copied from interface: IActionType
Get the plugin type.

Specified by:
getActionType in interface IActionType
Returns:
The type.

initialize

public void initialize(IContext context)
                throws PluginException
Description copied from interface: IPlugin
Initialize the plugin. Performed after set parameters.

Specified by:
initialize in interface IPlugin
Parameters:
context - The test context.
Throws:
PluginException - On initialization errors.

doStart

public ENext doStart(IContext context,
                     IResultSet result)
              throws PluginException
Description copied from interface: IPlugin
Performs the start action. i.e. create a database schema. Performed after initialization.

Specified by:
doStart in interface IPlugin
Parameters:
context - The context.
result - The result set.
Returns:
SKIP, to skip node, DEEP, to go deep into the node.
Throws:
PluginException - On execution errors.

doEnd

public void doEnd(IContext context,
                  IResultSet result)
           throws PluginException
Description copied from interface: IPlugin
The end action. i.e. after a loop specification perform something in a newly generated table. Performed after doStart().

Specified by:
doEnd in interface IPlugin
Parameters:
context - The context.
result - The result set.
Throws:
PluginException - On execution errors.

copy

public IPlugin copy(IContext context)
             throws PluginException
Description copied from interface: IPlugin
Creates a copy of this plugin.

Specified by:
copy in interface IPlugin
Parameters:
context - The context.
Returns:
A copy.
Throws:
PluginException - On copy errors.

getParameters

public IParameterDecorator getParameters()
Description copied from interface: IParameterHolder
Get parameters.

Specified by:
getParameters in interface IParameterHolder
Returns:
The parameters.

setParameters

public void setParameters(IParameterDecorator parameters)
Description copied from interface: IParameterHolder
Set the parameters.

Specified by:
setParameters in interface IParameterHolder
Parameters:
parameters - The parameters.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014. All rights reserved.