]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.structural2/src/org/simantics/structural2/variables/StructuralProceduralExpressionPropertyVariable.java
Merge "Fixes to thread safety problems in SCL compiler"
[simantics/platform.git] / bundles / org.simantics.structural2 / src / org / simantics / structural2 / variables / StructuralProceduralExpressionPropertyVariable.java
1 package org.simantics.structural2.variables;
2
3 import org.simantics.databoard.binding.Binding;
4 import org.simantics.db.ReadGraph;
5 import org.simantics.db.Resource;
6 import org.simantics.db.exception.DatabaseException;
7 import org.simantics.db.layer0.variable.StandardExpressionGraphPropertyVariable;
8 import org.simantics.db.layer0.variable.Variable;
9 import org.simantics.structural2.scl.CompileProceduralExpressionValueRequest;
10
11 public class StructuralProceduralExpressionPropertyVariable extends StandardExpressionGraphPropertyVariable {
12
13         public StructuralProceduralExpressionPropertyVariable(ReadGraph graph,
14                         Variable parent, Resource property, String expressionText)
15                         throws DatabaseException {
16                 super(graph, parent, property, expressionText);
17         }
18
19         @Override
20         protected Object compute(ReadGraph graph, Variable context) throws DatabaseException {
21                 return CompileProceduralExpressionValueRequest.compileAndEvaluate(graph, expressionText, context);
22         }
23
24         @Override
25         protected Object compute(ReadGraph graph, Variable context, Binding binding) throws DatabaseException {
26                 return CompileProceduralExpressionValueRequest.compileAndEvaluate(graph, expressionText, context);
27         }
28
29 }