--- /dev/null
+package org.simantics.databoard.container;\r
+\r
+import java.util.TreeMap;\r
+\r
+import org.simantics.databoard.binding.mutable.Variant;\r
+\r
+/**\r
+ * This is a container format primarly for encoding data to file system.\r
+ * It adds to the actual data encoded as a variant some metadata, format\r
+ * name and version information.\r
+ * @author Hannu Niemistö\r
+ */\r
+public class DataContainer {\r
+ /**\r
+ * Format name that tells how the data is used. \r
+ * Applications use format name to decide if the file can \r
+ * be used for the operation the user requested.\r
+ */\r
+ public String format;\r
+ /**\r
+ * Version number of the content format. Increased every\r
+ * time the data type or the interpretation of the data\r
+ * changes.\r
+ */\r
+ public int version;\r
+ /**\r
+ * May contain arbitrary metadata about the data such as\r
+ * author, export data etc.\r
+ */\r
+ public TreeMap<String, Variant> metadata;\r
+ /**\r
+ * The actual data content.\r
+ */\r
+ public Variant content;\r
+ \r
+ public DataContainer() {\r
+ }\r
+ \r
+ public DataContainer(String format, int version,\r
+ TreeMap<String, Variant> metadata, Variant content) {\r
+ this.format = format;\r
+ this.version = version;\r
+ this.metadata = metadata;\r
+ this.content = content;\r
+ }\r
+ \r
+ public DataContainer(String format, int version, Variant content) {\r
+ this(format, version, new TreeMap<String,Variant>(), content);\r
+ }\r
+}\r