org.specrunner.plugins.core.elements
Class AbstractPluginResourceReplaceable

java.lang.Object
  extended by org.specrunner.parameters.core.ParameterHolder
      extended by org.specrunner.plugins.core.AbstractPlugin
          extended by org.specrunner.plugins.core.elements.AbstractPluginResource
              extended by org.specrunner.plugins.core.elements.AbstractPluginResourceReplaceable
All Implemented Interfaces:
IParameterHolder, IActionType, IParalelPlugin, IPlugin, ISleepPlugin, ITestPlugin, ITimedPlugin, IWaitPlugin
Direct Known Subclasses:
AbstractPluginResourceReplaceableSrc, PluginLink

public abstract class AbstractPluginResourceReplaceable
extends AbstractPluginResource

Plugin to replace resources.

Author:
Thiago Santos

Field Summary
protected static ICache<String,String> pathToFile
          Cache of resources per output file.
protected static ThreadLocal<Integer> serialNumber
          Static sequential number.
 
Fields inherited from class org.specrunner.plugins.core.elements.AbstractPluginResource
FEATURE_SAVE
 
Fields inherited from class org.specrunner.plugins.core.AbstractPlugin
FEATURE_CONDITION, FEATURE_NORMALIZED, FEATURE_SLEEP, FEATURE_THREADSAFE, FEATURE_TIMEOUT, FEATURE_WAIT
 
Constructor Summary
AbstractPluginResourceReplaceable()
           
 
Method Summary
protected abstract  void addResource(ISource source, String path, nu.xom.Element element)
          Add the resource as a reference.
 ENext doStart(IContext context, IResultSet result)
          Performs the start action. i.e. create a database schema.
 ActionType getActionType()
          Get the plugin type.
protected abstract  String getReferenceName()
          Get attribute reference name.
protected abstract  String getReferenceValue()
          Get the previous attribute value.
protected  void replaceName(nu.xom.Element element, String newName)
          Replace old reference by the new created.
 
Methods inherited from class org.specrunner.plugins.core.elements.AbstractPluginResource
getSave, initialize, isSave, setSave
 
Methods inherited from class org.specrunner.plugins.core.AbstractPlugin
copy, doEnd, getCondition, getConditionModel, getNormalized, getNormalized, getParent, getSleep, getSleepModel, getThreadsafe, getTimeout, getTimeoutModel, getWait, getWaitModel, setCondition, setConditionModel, setNormalized, setParent, setSleep, setSleepModel, setThreadsafe, setTimeout, setTimeoutModel, setWait, setWaitModel, toString
 
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

pathToFile

protected static ICache<String,String> pathToFile
Cache of resources per output file.


serialNumber

protected static ThreadLocal<Integer> serialNumber
Static sequential number.

Constructor Detail

AbstractPluginResourceReplaceable

public AbstractPluginResourceReplaceable()
Method Detail

getActionType

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

Returns:
The type.

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
Overrides:
doStart in class AbstractPlugin
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.

getReferenceName

protected abstract String getReferenceName()
Get attribute reference name.

Returns:
The attribute name.

getReferenceValue

protected abstract String getReferenceValue()
Get the previous attribute value.

Returns:
The attribute (reference) value.

addResource

protected abstract void addResource(ISource source,
                                    String path,
                                    nu.xom.Element element)
Add the resource as a reference.

Parameters:
source - The source.
path - The target path.
element - The resource element.

replaceName

protected void replaceName(nu.xom.Element element,
                           String newName)
Replace old reference by the new created.

Parameters:
element - The element.
newName - The attribute new value.


Copyright © 2014. All rights reserved.