]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.databoard/src/org/simantics/databoard/serialization/SerializerScheme.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / serialization / SerializerScheme.java
diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/serialization/SerializerScheme.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/serialization/SerializerScheme.java
new file mode 100644 (file)
index 0000000..35079f3
--- /dev/null
@@ -0,0 +1,42 @@
+package org.simantics.databoard.serialization;\r
+\r
+import org.simantics.databoard.binding.Binding;\r
+\r
+/**\r
+ * Serialization scheme creates serializers for binding requests.\r
+ * \r
+ * {@link DefaultSerializerFactory} is a serialization scheme that follows\r
+ * Databoard serialization format specification. It can create serialization\r
+ * for any binding. \r
+ * \r
+ * @author Toni Kalajainen\r
+ */\r
+public interface SerializerScheme {\r
+\r
+       /**\r
+        * Get binding of a data type\r
+        * \r
+        * @param binding\r
+        * @return binding \r
+        * @throws SerializerConstructionException if data type is not supported\r
+        */\r
+       Serializer getSerializer(Binding binding) throws SerializerConstructionException;\r
+\r
+       /**\r
+        * Get binding of a data type\r
+        * \r
+        * @param binding\r
+        * @return binding \r
+        * @throws RuntimeSerializerConstructionException if data type is not supported\r
+        */\r
+       Serializer getSerializerUnchecked(Binding binding) throws RuntimeSerializerConstructionException;\r
+\r
+       /**\r
+        * Tests if the scheme supports a binding\r
+        * \r
+        * @param binding\r
+        * @return true if the binding is supported by the scheme\r
+        */\r
+       boolean supportsBinding(Binding binding);\r
+       \r
+}\r