1 package org.simantics.databoard.container;
3 import java.util.TreeMap;
5 import org.simantics.databoard.binding.mutable.Variant;
8 * This is a container format primarly for encoding data to file system.
9 * It adds to the actual data encoded as a variant some metadata, format
10 * name and version information.
11 * @author Hannu Niemistö
13 public class DataContainer {
15 * Format name that tells how the data is used.
16 * Applications use format name to decide if the file can
17 * be used for the operation the user requested.
21 * Version number of the content format. Increased every
22 * time the data type or the interpretation of the data
27 * May contain arbitrary metadata about the data such as
28 * author, export data etc.
30 public TreeMap<String, Variant> metadata;
32 * The actual data content.
34 public Variant content;
36 public DataContainer() {
39 public DataContainer(String format, int version,
40 TreeMap<String, Variant> metadata, Variant content) {
42 this.version = version;
43 this.metadata = metadata;
44 this.content = content;
47 public DataContainer(String format, int version, Variant content) {
48 this(format, version, new TreeMap<String,Variant>(), content);