org.specrunner.plugins.core.objects
Class AbstractPluginObjectSelect<T>

java.lang.Object
  extended by org.specrunner.parameters.core.ParameterHolder
      extended by org.specrunner.plugins.core.AbstractPlugin
          extended by org.specrunner.plugins.core.AbstractPluginNamed
              extended by org.specrunner.plugins.core.AbstractPluginScoped
                  extended by org.specrunner.plugins.core.AbstractPluginTable
                      extended by org.specrunner.plugins.core.objects.AbstractPluginObject
                          extended by org.specrunner.plugins.core.objects.AbstractPluginObjectSelect<T>
Type Parameters:
T - The source type.
All Implemented Interfaces:
IParameterHolder, IActionType, IParalelPlugin, IPlugin, ISleepPlugin, ITestPlugin, ITimedPlugin, IWaitPlugin
Direct Known Subclasses:
AbstractPluginObjectSelectNone, AbstractPluginObjectSelectUnique

public abstract class AbstractPluginObjectSelect<T>
extends AbstractPluginObject

Perform something on a selected object.

Author:
Thiago Santos

Nested Class Summary
 
Nested classes/interfaces inherited from class org.specrunner.plugins.core.objects.AbstractPluginObject
AbstractPluginObject.Field
 
Field Summary
protected  IObjectSelector<T> selector
          The default object selector.
protected  T source
          The source.
 
Fields inherited from class org.specrunner.plugins.core.objects.AbstractPluginObject
creator, creatorInstance, fields, generic, instances, keysBefore, mapping, reference, references, separator, type, typeInstance
 
Fields inherited from class org.specrunner.plugins.core.AbstractPlugin
FEATURE_CONDITION, FEATURE_NORMALIZED, FEATURE_SLEEP, FEATURE_THREADSAFE, FEATURE_TIMEOUT, FEATURE_WAIT
 
Constructor Summary
AbstractPluginObjectSelect(IObjectSelector<T> selector)
          Create a select plugin, provided an object selector.
 
Method Summary
protected  void action(IContext context, Object instance, RowAdapter row, IResultSet result)
          This method can be and should be overridden to perform save, comparison, etc for updates.
 ActionType getActionType()
          Get the plugin type.
 boolean isMapped()
          Says if the instance show be mapped or not.
abstract  void processList(IContext context, Object instance, RowAdapter row, IResultSet result, List<Object> list)
          Process the list of objects recovered.
 
Methods inherited from class org.specrunner.plugins.core.objects.AbstractPluginObject
create, doEnd, getCreator, getCreatorInstance, getMapping, getObject, getReference, getSeparator, getType, getTypeInstance, initialize, loadFields, loadMapping, makeKey, mapObject, merge, populate, processLine, removeObject, setBoolean, setChar, setCreator, setCreatorInstance, setDouble, setEntity, setFloat, setInteger, setLong, setMapping, setObject, setObjectInformation, setReference, setSeparator, setShort, setType, setTypeInstance, setValue
 
Methods inherited from class org.specrunner.plugins.core.AbstractPluginTable
doEnd, doStart, doStart, initialize, toString
 
Methods inherited from class org.specrunner.plugins.core.AbstractPluginScoped
getScope, saveGlobal, saveLocal, saveStrict, setScope
 
Methods inherited from class org.specrunner.plugins.core.AbstractPluginNamed
getName, setName
 
Methods inherited from class org.specrunner.plugins.core.AbstractPlugin
copy, getCondition, getConditionModel, getNormalized, getNormalized, getParent, getSleep, getSleepModel, getThreadsafe, getTimeout, getTimeoutModel, getWait, getWaitModel, setCondition, setConditionModel, setNormalized, setParent, setSleep, setSleepModel, setThreadsafe, setTimeout, setTimeoutModel, setWait, setWaitModel
 
Methods inherited from class org.specrunner.parameters.core.ParameterHolder
getParameters, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.specrunner.parameters.IParameterHolder
getParameters, setParameters
 

Field Detail

selector

protected IObjectSelector<T> selector
The default object selector.


source

protected T source
The source.

Constructor Detail

AbstractPluginObjectSelect

public AbstractPluginObjectSelect(IObjectSelector<T> selector)
Create a select plugin, provided an object selector.

Parameters:
selector - The selector.
Method Detail

getActionType

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

Returns:
The type.

isMapped

public boolean isMapped()
Description copied from class: AbstractPluginObject
Says if the instance show be mapped or not.

Specified by:
isMapped in class AbstractPluginObject
Returns:
true, to map, false, otherwise.

action

protected void action(IContext context,
                      Object instance,
                      RowAdapter row,
                      IResultSet result)
               throws Exception
Description copied from class: AbstractPluginObject
This method can be and should be overridden to perform save, comparison, etc for updates.

Specified by:
action in class AbstractPluginObject
Parameters:
context - Test context.
instance - The object instance.
row - The row adapter.
result - The result set.
Throws:
Exception - On action errors.

processList

public abstract void processList(IContext context,
                                 Object instance,
                                 RowAdapter row,
                                 IResultSet result,
                                 List<Object> list)
                          throws Exception
Process the list of objects recovered.

Parameters:
context - The context.
instance - The row instance.
row - The row.
result - The result set.
list - The list of objects recovered.
Throws:
Exception - On processing errors.


Copyright © 2014. All rights reserved.