public interface ExpressionBuilder
Expression expr = builder.appendVariable(var_1)
.append(" + ")
.appendVariable(var_2)
.append(" + 5")
.build();
The expression built will have information about the entities and their type (in the example the variables var_1 and var_2).
Should the entities for some reason not be present the expression can still be valid but will be undefined.
This can be the case for installation variables for instance, if the wrong installation is loaded
or the user has deleted the variable. When the variable becomes present again, the expression will become defined.Modifier and Type | Method and Description |
---|---|
ExpressionBuilder |
append(String expressionPart)
Append a string part of the expression.
|
ExpressionBuilder |
appendFeature(Feature feature)
Append a Feature object to the expression.
|
ExpressionBuilder |
appendIO(IO io)
Append an I/O object to the expression.
|
ExpressionBuilder |
appendVariable(Variable variable)
Append a variable object to the expression.
|
ExpressionBuilder |
appendWaypoint(WaypointNode waypoint)
Append a waypoint to the expression.
|
Expression |
build()
Build the expression consisting of all the appended parts.
|
ExpressionBuilder append(String expressionPart)
expressionPart
- the expression part to be appended.ExpressionBuilder appendVariable(Variable variable)
variable
- the variable to append.ExpressionBuilder appendFeature(Feature feature)
feature
- the Feature to appendExpressionBuilder appendWaypoint(WaypointNode waypoint)
waypoint
- the waypoint to appendExpressionBuilder appendIO(IO io)
io
- the I/O to append.Expression build() throws InvalidExpressionException
InvalidExpressionException
- if the expression is syntactically incorrect/invalid.Copyright © 2018. All rights reserved.