1 package org.simantics.db.layer0.adapter;
3 import org.simantics.db.ConverterExternalValue;
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.scl.CompileValueRequest;
8 import org.simantics.layer0.Layer0;
9 import org.simantics.scl.reflection.ReflectionUtils;
10 import org.simantics.scl.reflection.ValueNotFoundException;
11 import org.simantics.scl.runtime.function.Function1;
13 public class SCLExternalValue implements ConverterExternalValue {
16 public <T> T getValue(ReadGraph graph, Resource resource) throws DatabaseException {
18 return (T)ReflectionUtils.getValue(Layer0.URIs.Functions_computeExpression).getValue();
19 } catch (ValueNotFoundException e) {
20 throw new DatabaseException(e);
25 public Function1 getFunction(ReadGraph graph, Resource s, Resource o, Resource p) throws DatabaseException {
26 return CompileValueRequest.compile(graph, s, o, p);