org.hawk.module.script
Class IfScript
java.lang.Object
org.hawk.module.script.AbstractScript
org.hawk.module.script.MultiLineScript
org.hawk.module.script.IfScript
- All Implemented Interfaces:
- IScript
- Direct Known Subclasses:
- ElseIfScript
public class IfScript
- extends MultiLineScript
Methods inherited from class org.hawk.module.script.MultiLineScript |
addScript, addScripts, copy, extractMultiLineContainer, findArrayType, findNearestOuterMLScript, getFunctionScript, getInnerScripts, getLocalValue, getLocalValue, getMultiLineContainer, getStructVariable, getVariable, getVariableValue, isDefaultMultiLineScript, isInside, isInside, isLocalVarDeclared, parseMultiLines, popLocalVars, pushLocalVars, setDefaultMultiLineScript, setFunctionScript, setInnerScripts, setLocalValue, setMultiLineContainer, setVariable, setVariableValue, toUI, unsetAllLocalValue, unsetLocalValue |
Methods inherited from class org.hawk.module.script.AbstractScript |
add, and, arrayBracket, assign, divide, equalTo, evaluateGlobalVariable, evaluateLocalBoolean, evaluateLocalVariable, getLineNumber, getOuterMultiLineScript, greaterThan, greaterThanEqualTo, isLastScript, lessThan, lessThanEqualTo, mangle, modulus, multiply, or, refer, setLastScript, setLineNumber, setOuterMultiLineScript, subtract, toJava, toJavaMap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
expression
protected java.lang.String expression
elseIfScript
protected ElseIfScript elseIfScript
IfScript
public IfScript()
getElseIfScript
public ElseIfScript getElseIfScript()
setElseIfScript
public void setElseIfScript(ElseIfScript elseIfScript)
getExpression
public java.lang.String getExpression()
setExpression
public void setExpression(java.lang.String expression)
evaluate
public boolean evaluate()
throws HawkException
- Throws:
HawkException
hasElseCondition
public boolean hasElseCondition()
execute
public Variable execute()
throws HawkException
- Description copied from interface:
IScript
- This executes the contents of a script.
This returns either a boolean or double
depending upon how a method is invoked.
- Specified by:
execute
in interface IScript
- Overrides:
execute
in class MultiLineScript
- Returns:
- the returned data is being used to test whether
a function returns or not. Currently Hawk support two types return
Double and Boolean.The implementation should look at the return type
and script type to determine what action to be taken.
- Throws:
HawkException
isVariable
public boolean isVariable()
- Specified by:
isVariable
in interface IScript
- Overrides:
isVariable
in class MultiLineScript
- Returns:
createScript
public static int createScript(MultiLineScript multiLineScript,
int i)
throws HawkException
- This returns EchoScript from echo matcher map.
- Parameters:
lineEchoMatcherMap
-
- Returns:
-
- Throws:
HawkException