]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.document.server/src/org/simantics/document/server/request/ServerSCLHandlerValueRequest.java
New implementation of server state based on StandardNodeManager
[simantics/platform.git] / bundles / org.simantics.document.server / src / org / simantics / document / server / request / ServerSCLHandlerValueRequest.java
index 2071b8323646596c9fa86c0d1c0fc734a9773b95..4a4164303613c1a2c9d963693804d727305cdb2a 100644 (file)
@@ -40,6 +40,7 @@ public class ServerSCLHandlerValueRequest extends AbstractExpressionCompilationR
        private final Variable context;
        private final Pair<Resource,Resource> componentTypeAndRoot;
        private final Resource literal;
+       protected String possibleExpectedValueType;
 
        public static class CompilationContext extends AbstractExpressionCompilationContext {
                public final Map<String, ComponentTypeProperty> propertyMap;
@@ -51,15 +52,16 @@ public class ServerSCLHandlerValueRequest extends AbstractExpressionCompilationR
                }
        }
 
-       private ServerSCLHandlerValueRequest(Variable context, Pair<Resource,Resource> componentTypeAndRoot, Resource literal) {
+       private ServerSCLHandlerValueRequest(Variable context, Pair<Resource,Resource> componentTypeAndRoot, Resource literal, String possibleExpectedValueType) {
                assert(literal != null);
                this.context = context;
                this.literal = literal;
                this.componentTypeAndRoot = componentTypeAndRoot;
+               this.possibleExpectedValueType = possibleExpectedValueType;
        }
 
        public ServerSCLHandlerValueRequest(ReadGraph graph, Variable context) throws DatabaseException {
-               this(context, getComponentTypeAndRoot(graph, context), context.getRepresents(graph));
+               this(context, getComponentTypeAndRoot(graph, context), context.getRepresents(graph), resolveExpectedValueType(graph, context));
        }
 
        private static Pair<Resource,Resource> getComponentTypeAndRoot(ReadGraph graph, Variable property)  throws DatabaseException {
@@ -220,6 +222,11 @@ public class ServerSCLHandlerValueRequest extends AbstractExpressionCompilationR
                        return null;
        }
 
+    @Override
+    protected Type getExpectedType(ReadGraph graph, CompilationContext context) throws DatabaseException {
+        return super.getExpectedType(graph, context);
+    }
+
        @Override
        public int hashCode() {
                final int prime = 31;