]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.common/src/org/simantics/db/common/validation/L0Validations.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.db.common / src / org / simantics / db / common / validation / L0Validations.java
index 4a8122956d8247dc900d92e0893b031da0881b11..a1ed10e77626c56c063aecbabfaa9fd313a2c642 100644 (file)
@@ -1,43 +1,43 @@
-package org.simantics.db.common.validation;\r
-\r
-import org.simantics.databoard.Bindings;\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.common.utils.NameUtils;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.layer0.Layer0;\r
-\r
-public class L0Validations {\r
-\r
-       public static String checkValueType(ReadGraph graph, Resource subject, Resource predicate) throws DatabaseException {\r
-               if (subject == null)\r
-                       return null;\r
-               if (predicate == null)\r
-                       return null;\r
-\r
-               Layer0 L0 = Layer0.getInstance(graph);\r
-           if(graph.isSubrelationOf(predicate, L0.HasProperty)) {\r
-                       Resource object = graph.getPossibleObject(subject, predicate);\r
-                       if(object == null) return null;\r
-               String valueType = graph.getPossibleRelatedValue(predicate, L0.RequiresValueType, Bindings.STRING);\r
-               if(valueType != null) {\r
-                       String valueType2 = graph.getPossibleRelatedValue(object, L0.HasValueType, Bindings.STRING);\r
-                       if(!valueType.equals(valueType2)) {\r
-                                       StringBuilder sb = new StringBuilder()\r
-                                       .append("The value type ")\r
-                                       .append(valueType)\r
-                                       .append(" of predicate ")\r
-                                       .append(NameUtils.getSafeName(graph, predicate, true))\r
-                                       .append(" does not match the value type ")\r
-                                       .append(valueType2)\r
-                                       .append(" of object ")\r
-                                       .append(NameUtils.getSafeName(graph, object, true))\r
-                                       .append(".");\r
-                                       return sb.toString();\r
-                       }\r
-               }\r
-           }\r
-           return null;\r
-       }\r
-       \r
-}\r
+package org.simantics.db.common.validation;
+
+import org.simantics.databoard.Bindings;
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.common.utils.NameUtils;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.layer0.Layer0;
+
+public class L0Validations {
+
+       public static String checkValueType(ReadGraph graph, Resource subject, Resource predicate) throws DatabaseException {
+               if (subject == null)
+                       return null;
+               if (predicate == null)
+                       return null;
+
+               Layer0 L0 = Layer0.getInstance(graph);
+           if(graph.isSubrelationOf(predicate, L0.HasProperty)) {
+                       Resource object = graph.getPossibleObject(subject, predicate);
+                       if(object == null) return null;
+               String valueType = graph.getPossibleRelatedValue(predicate, L0.RequiresValueType, Bindings.STRING);
+               if(valueType != null) {
+                       String valueType2 = graph.getPossibleRelatedValue(object, L0.HasValueType, Bindings.STRING);
+                       if(!valueType.equals(valueType2)) {
+                                       StringBuilder sb = new StringBuilder()
+                                       .append("The value type ")
+                                       .append(valueType)
+                                       .append(" of predicate ")
+                                       .append(NameUtils.getSafeName(graph, predicate, true))
+                                       .append(" does not match the value type ")
+                                       .append(valueType2)
+                                       .append(" of object ")
+                                       .append(NameUtils.getSafeName(graph, object, true))
+                                       .append(".");
+                                       return sb.toString();
+                       }
+               }
+           }
+           return null;
+       }
+       
+}