public class ConditionInterpreter
extends java.lang.Object
The condition interpreter supports:
Supported comparison operators:
Supported boolean operators:
Parsing of values:
Constructor and Description |
---|
ConditionInterpreter(java.lang.String parserInput)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addPredefinedVariable(java.lang.String variableName,
java.lang.String value)
Add a predefined variable.
|
boolean |
execute()
Execute the condition interpreter.
|
ReplaceVariableLiteralsInContent |
getReplaceVariableLiteralsInContent()
Get data about the replaced variables.
|
static java.util.List<java.lang.String> |
getRequiredVariableNames(java.lang.String parserInput)
Utility: Get the required 'variable names' of a parser input which are formal valid.
|
static java.util.List<java.lang.String> |
getRequiredVariableNames(java.lang.String parserInput,
boolean onlyFormalValidVariableNames)
Utility: Get the required 'variable names' of a parser input.
|
static void |
main(java.lang.String[] args)
Internal test program.
|
public ConditionInterpreter(java.lang.String parserInput) throws InterpreterException
parserInput
- the interpreter inputInterpreterException
- if the parserInput is null or an empty stringpublic void addPredefinedVariable(java.lang.String variableName, java.lang.String value)
variableName
- the variable namevalue
- the value of the variable (as text)public boolean execute() throws InterpreterException
InterpreterException
- if a syntax error is detected during parsingpublic ReplaceVariableLiteralsInContent getReplaceVariableLiteralsInContent()
execute()
public static java.util.List<java.lang.String> getRequiredVariableNames(java.lang.String parserInput, boolean onlyFormalValidVariableNames)
parserInput
- the parser inputonlyFormalValidVariableNames
- if true get only formal valid 'variable names'ReplaceVariableLiteralsInContent.DEFAULT_LEFT_SIDE_PATTERN
,
ReplaceVariableLiteralsInContent.DEFAULT_RIGHT_SIDE_PATTERN
,
Utils.isFormalValidVariableName(String)
public static java.util.List<java.lang.String> getRequiredVariableNames(java.lang.String parserInput)
parserInput
- the parser inputReplaceVariableLiteralsInContent.DEFAULT_LEFT_SIDE_PATTERN
,
ReplaceVariableLiteralsInContent.DEFAULT_RIGHT_SIDE_PATTERN
,
Utils.isFormalValidVariableName(String)
public static void main(java.lang.String[] args)
args
- [no args]