]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.common/src/org/simantics/db/common/request/AdaptValue.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.db.common / src / org / simantics / db / common / request / AdaptValue.java
index 82b6bf965ee0dc94f59a5eec005ada2b3c178dfb..02877596b00d4423fac8387a31bdc73cdde76e87 100644 (file)
@@ -1,47 +1,47 @@
-package org.simantics.db.common.request;\r
-\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.common.utils.Functions;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.exception.RuntimeDatabaseException;\r
-import org.simantics.layer0.Layer0;\r
-import org.simantics.scl.reflection.ReflectionUtils;\r
-import org.simantics.scl.reflection.ValueNotFoundException;\r
-import org.simantics.scl.runtime.function.FunctionImpl3;\r
-\r
-/**\r
- * Adapts a resource to (SCL) value.\r
- * @author Hannu Niemistö\r
- */\r
-public class AdaptValue extends ResourceRead<Object> {\r
-    \r
-    public AdaptValue(Resource resource) {\r
-        super(resource);\r
-    }\r
-\r
-    private static final FunctionImpl3<ReadGraph,Resource,Object,Object> functionApplication = new FunctionImpl3<ReadGraph,Resource,Object,Object>() {\r
-\r
-               @Override\r
-               public Object apply(ReadGraph graph, Resource resource, Object context) {\r
-                       try {\r
-                               return Functions.exec(graph, resource, graph, resource, context);\r
-                       } catch (DatabaseException e) {\r
-                               throw new RuntimeDatabaseException(e);\r
-                       }\r
-               }\r
-\r
-       };\r
-    \r
-    @Override\r
-    public Object perform(ReadGraph graph) throws DatabaseException {\r
-        String uri = graph.getURI(resource);        \r
-        try {\r
-                       if(Layer0.URIs.Functions_functionApplication.equals(uri)) return functionApplication;\r
-            return ReflectionUtils.getValue(uri).getValue();\r
-        } catch (ValueNotFoundException e) {\r
-            throw new DatabaseException("Couldn't adapt the value " + uri, e);\r
-        }\r
-    }\r
-\r
-}\r
+package org.simantics.db.common.request;
+
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.common.utils.Functions;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.exception.RuntimeDatabaseException;
+import org.simantics.layer0.Layer0;
+import org.simantics.scl.reflection.ReflectionUtils;
+import org.simantics.scl.reflection.ValueNotFoundException;
+import org.simantics.scl.runtime.function.FunctionImpl3;
+
+/**
+ * Adapts a resource to (SCL) value.
+ * @author Hannu Niemist&ouml;
+ */
+public class AdaptValue extends ResourceRead<Object> {
+    
+    public AdaptValue(Resource resource) {
+        super(resource);
+    }
+
+    private static final FunctionImpl3<ReadGraph,Resource,Object,Object> functionApplication = new FunctionImpl3<ReadGraph,Resource,Object,Object>() {
+
+               @Override
+               public Object apply(ReadGraph graph, Resource resource, Object context) {
+                       try {
+                               return Functions.exec(graph, resource, graph, resource, context);
+                       } catch (DatabaseException e) {
+                               throw new RuntimeDatabaseException(e);
+                       }
+               }
+
+       };
+    
+    @Override
+    public Object perform(ReadGraph graph) throws DatabaseException {
+        String uri = graph.getURI(resource);        
+        try {
+                       if(Layer0.URIs.Functions_functionApplication.equals(uri)) return functionApplication;
+            return ReflectionUtils.getValue(uri).getValue();
+        } catch (ValueNotFoundException e) {
+            throw new DatabaseException("Couldn't adapt the value " + uri, e);
+        }
+    }
+
+}