]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/PassthroughSerializerBinding.java
Delete temporary files after use in delayed writes and model TG export
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / graph / PassthroughSerializerBinding.java
diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/PassthroughSerializerBinding.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/PassthroughSerializerBinding.java
new file mode 100644 (file)
index 0000000..8c95a51
--- /dev/null
@@ -0,0 +1,174 @@
+package org.simantics.db.impl.graph;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.IdentityHashMap;
+import java.util.List;
+import java.util.Set;
+
+import org.simantics.databoard.accessor.reference.ChildReference;
+import org.simantics.databoard.binding.Binding;
+import org.simantics.databoard.binding.impl.BindingPrintContext;
+import org.simantics.databoard.serialization.SerializationException;
+import org.simantics.databoard.serialization.Serializer;
+import org.simantics.databoard.util.IdentityPair;
+
+import gnu.trove.map.hash.TObjectIntHashMap;
+
+/**
+ * Originally within DelayedWriteGraph, put in separate file in 1.30.0.
+ * 
+ * @author Antti Villberg
+ */
+class PassthroughSerializerBinding extends Binding {
+
+       static final Serializer serializer = new Serializer() {
+
+               public byte[] serialize(Object obj) throws SerializationException {
+                       return (byte[])obj;
+               }
+
+               @Override
+               public void serialize(DataOutput out,
+                               TObjectIntHashMap<Object> identities, Object obj)
+                               throws IOException {
+                       throw new Error("Not supported.");
+               }
+
+               @Override
+               public void serialize(DataOutput out, Object obj)
+                               throws IOException {
+                       throw new Error("Not supported.");
+               }
+
+               @Override
+               public Object deserialize(DataInput in, List<Object> identities)
+                               throws IOException {
+                       throw new Error("Not supported.");
+               }
+
+               @Override
+               public Object deserialize(DataInput in) throws IOException {
+                       throw new Error("Not supported.");
+               }
+
+               @Override
+               public void deserializeTo(DataInput in, List<Object> identities,
+                               Object obj) throws IOException {
+                       throw new Error("Not supported.");
+               }
+
+               @Override
+               public void deserializeTo(DataInput in, Object obj)
+                               throws IOException {
+                       throw new Error("Not supported.");
+               }
+
+               @Override
+               public void skip(DataInput in, List<Object> identities)
+                               throws IOException {
+                       throw new Error("Not supported.");
+               }
+
+               @Override
+               public void skip(DataInput in) throws IOException {
+                       throw new Error("Not supported.");
+               }
+
+               @Override
+               public Integer getConstantSize() {
+                       throw new Error("Not supported.");
+               }
+
+               @Override
+               public int getSize(Object obj, TObjectIntHashMap<Object> identities)
+                               throws IOException {
+                       throw new Error("Not supported.");
+               }
+
+               @Override
+               public int getSize(Object obj) throws IOException {
+                       throw new Error("Not supported.");
+               }
+
+               @Override
+               public int getMinSize() {
+                       throw new Error("Not supported.");
+               }
+
+       };
+
+       @Override
+       public Serializer serializer() {
+               return serializer;
+       }
+
+       @Override
+       public void accept(Visitor1 v, Object obj) {
+               throw new Error("Not supported.");
+       }
+
+       @Override
+       public <T> T accept(Visitor<T> v) {
+               throw new Error("Not supported.");
+       }
+
+       @Override
+       public boolean isInstance(Object obj) {
+               throw new Error("Not supported.");
+       }
+
+       @Override
+       public void assertInstaceIsValid(Object obj, Set<Object> validInstances)
+                       throws org.simantics.databoard.binding.error.BindingException {
+               throw new Error("Not supported.");
+       }
+
+       @Override
+       public int deepHashValue(Object value,
+                       IdentityHashMap<Object, Object> hashedObjects)
+                       throws org.simantics.databoard.binding.error.BindingException {
+               throw new Error("Not supported.");
+       }
+
+       @Override
+       public int deepCompare(Object o1, Object o2,
+                       Set<IdentityPair<Object, Object>> compareHistory)
+                       throws org.simantics.databoard.binding.error.BindingException {
+               throw new Error("Not supported.");
+       }
+
+       @Override
+       public void readFrom(Binding srcBinding, Object src, Object dst)
+                       throws org.simantics.databoard.binding.error.BindingException {
+               throw new Error("Not supported.");
+       }
+
+       @Override
+       public Object readFromTry(Binding srcBinding, Object src, Object dst)
+                       throws org.simantics.databoard.binding.error.BindingException {
+               throw new Error("Not supported.");
+       }
+
+       @Override
+       protected void toString(Object value, BindingPrintContext ctx) throws org.simantics.databoard.binding.error.BindingException {
+               throw new Error("Not supported.");
+       }
+
+       @Override
+       public int getComponentCount() {
+               throw new Error("Not supported.");
+       }
+
+       @Override
+       public Binding getComponentBinding(int index) {
+               throw new Error("Not supported.");
+       }
+
+       @Override
+       public Binding getComponentBinding(ChildReference path) {
+               throw new Error("Not supported.");
+       }
+
+}
\ No newline at end of file