org.specrunner.plugins.core
Class AbstractPluginScoped

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
All Implemented Interfaces:
IParameterHolder, IActionType, IParalelPlugin, IPlugin, ISleepPlugin, ITestPlugin, ITimedPlugin, IWaitPlugin
Direct Known Subclasses:
AbstractPluginTable, AbstractPluginValue, PluginHtml, PluginIterable, PluginMacro

public abstract class AbstractPluginScoped
extends AbstractPluginNamed

A plugin with scope information. i.e. for declaring variables a scope can be set.

Author:
Thiago Santos

Field Summary
 
Fields inherited from class org.specrunner.plugins.core.AbstractPlugin
FEATURE_CONDITION, FEATURE_NORMALIZED, FEATURE_SLEEP, FEATURE_THREADSAFE, FEATURE_TIMEOUT, FEATURE_WAIT
 
Constructor Summary
AbstractPluginScoped()
           
 
Method Summary
 String getScope()
          The scope value.
protected  void saveGlobal(IContext context, String name, Object value)
          Save the value to the context, using the given scope, if specified, otherwise to the global scope.
protected  void saveLocal(IContext context, String name, Object value)
          Save the value to the context, using the given scope, if specified, otherwise to the local scope.
protected  void saveStrict(IContext context, String name, Object value)
          Save the value to the context, using the given scope, if specified, otherwise to the strict scope.
 void setScope(String scope)
          Sets scope. i.e. if scope is set to 'body' means that a local variable must be associated to the body context.
 
Methods inherited from class org.specrunner.plugins.core.AbstractPluginNamed
getName, setName
 
Methods inherited from class org.specrunner.plugins.core.AbstractPlugin
copy, doEnd, doStart, getCondition, getConditionModel, getNormalized, getNormalized, getParent, getSleep, getSleepModel, getThreadsafe, getTimeout, getTimeoutModel, getWait, getWaitModel, initialize, 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
 
Methods inherited from interface org.specrunner.plugins.IActionType
getActionType
 

Constructor Detail

AbstractPluginScoped

public AbstractPluginScoped()
Method Detail

getScope

public String getScope()
The scope value.

Returns:
The scope.

setScope

public void setScope(String scope)
Sets scope. i.e. if scope is set to 'body' means that a local variable must be associated to the body context.

Parameters:
scope - A new scope.

saveStrict

protected void saveStrict(IContext context,
                          String name,
                          Object value)
Save the value to the context, using the given scope, if specified, otherwise to the strict scope.

Parameters:
context - The context.
name - The variable name.
value - The variable value.

saveLocal

protected void saveLocal(IContext context,
                         String name,
                         Object value)
Save the value to the context, using the given scope, if specified, otherwise to the local scope.

Parameters:
context - The context.
name - The variable name.
value - The variable value.

saveGlobal

protected void saveGlobal(IContext context,
                          String name,
                          Object value)
Save the value to the context, using the given scope, if specified, otherwise to the global scope.

Parameters:
context - The context.
name - The variable name.
value - The variable value.


Copyright © 2014. All rights reserved.