public class PluginWhile extends AbstractPluginValue
Example:
While the number of elements x (initially 10) is bigger than 5 (x>5), calculate:
x square cubic ${x} ${x * x} ${x * x * x}
The CSS annotated version:
<div>
While the number of elements <span class="local" name="x" value="10">x (initially 10)</span> is bigger than 5 (x>5), calculate:
<table border=1>
<tr>
<th>x</th>
<th>square</th>
<th>cubic</th>
</tr>
<tbody class="while" test="x>5">
<tr >
<td>${x}</td>
<td>${x * x}</td>
<td>${x * x * x}</td>
</tr>
<local scope="div" name="x" value="x-1"/>
<tbody>
</table>
</div>
Alternative version using "condition". * The CSS annotated
version:
<div>
While the number of elements <span class="local" name="x" value="10">x (initially 10)</span> is bigger than 5 (<span class="condition" name="cond1">x>5</span>), calculate:
<table border=1>
<tr>
<th>x</th>
<th>square</th>
<th>cubic</th>
</tr>
<tbody class="while" name="cond1">
<tr >
<td>${x}</td>
<td>${x * x}</td>
<td>${x * x * x}</td>
</tr>
<local scope="div" name="x" value="x-1"/>
<tbody>
</table>
</div>
eval, valuescopenameFEATURE_CONDITION, FEATURE_NORMALIZED, FEATURE_NORMALIZER, FEATURE_SLEEP, FEATURE_THREADSAFE, FEATURE_TIMEOUT, FEATURE_WAITparameters| Constructor and Description |
|---|
PluginWhile() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkCondition(String test,
IContext context)
Check condition.
|
ENext |
doStart(IContext context,
IResultSet result)
Performs the start action.
|
ActionType |
getActionType()
Get the plugin type.
|
getValue, getValue, isEval, setEval, setValuegetScope, saveGlobal, saveLocal, saveStrict, setScopegetName, setNamecopy, doEnd, getCondition, getConditionModel, getNormalized, getNormalized, getNormalizer, getParent, getSleep, getSleepModel, getThreadsafe, getTimeout, getTimeoutModel, getWait, getWaitModel, initialize, setCondition, setConditionModel, setNormalized, setNormalizer, setParent, setSleep, setSleepModel, setThreadsafe, setTimeout, setTimeoutModel, setWait, setWaitModel, toStringgetParameters, setParametersclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetParameters, setParameterspublic ActionType getActionType()
IActionTypepublic ENext doStart(IContext context, IResultSet result) throws PluginException
IPlugindoStart in interface IPlugindoStart in class AbstractPlugincontext - The context.result - The result set.PluginException - On execution errors.protected boolean checkCondition(String test, IContext context) throws PluginException
test - The condition.context - The context.PluginException - On evaluation errors.Copyright © 2016. All rights reserved.