org.specrunner.plugins.core
Class AbstractPluginValue

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.AbstractPluginValue
All Implemented Interfaces:
IParameterHolder, IActionType, IParalelPlugin, IPlugin, ISleepPlugin, ITestPlugin, ITimedPlugin, IWaitPlugin
Direct Known Subclasses:
AbstractPluginDual, PluginIf, PluginImport, PluginVerifyRows, PluginWhile

public abstract class AbstractPluginValue
extends AbstractPluginScoped

Stand for a plugin with a value attribute, or a value which must be calculate by evaluating the content of the specification.

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
AbstractPluginValue()
           
 
Method Summary
 Object getValue()
          Get the value attribute.
protected  Object getValue(Object str, boolean evaluate, IContext context)
          Gets a value based on a string.
 boolean isEval()
          Says if the content must be evaluated as an expression.
 void setEval(boolean eval)
          Sets evaluation.
 void setValue(Object value)
          Sets the value.
 
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, 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

AbstractPluginValue

public AbstractPluginValue()
Method Detail

isEval

public boolean isEval()
Says if the content must be evaluated as an expression.

Returns:
true, if evaluate is enable, false, otherwise. Default is false.

setEval

public void setEval(boolean eval)
Sets evaluation.

Parameters:
eval - true, to enable evaluation, false, otherwise.

getValue

public Object getValue()
Get the value attribute.

Returns:
The value.

setValue

public void setValue(Object value)
Sets the value.

Parameters:
value - A new value.

getValue

protected Object getValue(Object str,
                          boolean evaluate,
                          IContext context)
                   throws PluginException
Gets a value based on a string. If the plugin attribute value is set use the 'value' attribute, otherwise use the given string.

Parameters:
str - The string to be used, in case of value attribute not set.
evaluate - true, if evaluate as expression is required, false, otherwise.
context - The context.
Returns:
The object result of the evaluation.
Throws:
PluginException - On case of evaluation error.


Copyright © 2014. All rights reserved.