]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/PassthroughSerializerBinding.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / graph / PassthroughSerializerBinding.java
1 package org.simantics.db.impl.graph;
2
3 import java.io.DataInput;
4 import java.io.DataOutput;
5 import java.io.IOException;
6 import java.util.IdentityHashMap;
7 import java.util.List;
8 import java.util.Set;
9
10 import org.simantics.databoard.accessor.reference.ChildReference;
11 import org.simantics.databoard.binding.Binding;
12 import org.simantics.databoard.binding.impl.BindingPrintContext;
13 import org.simantics.databoard.serialization.SerializationException;
14 import org.simantics.databoard.serialization.Serializer;
15 import org.simantics.databoard.util.IdentityPair;
16
17 import gnu.trove.map.hash.TObjectIntHashMap;
18
19 /**
20  * Originally within DelayedWriteGraph, put in separate file in 1.30.0.
21  * 
22  * @author Antti Villberg
23  */
24 class PassthroughSerializerBinding extends Binding {
25
26         static final Serializer serializer = new Serializer() {
27
28                 public byte[] serialize(Object obj) throws SerializationException {
29                         return (byte[])obj;
30                 }
31
32                 @Override
33                 public void serialize(DataOutput out,
34                                 TObjectIntHashMap<Object> identities, Object obj)
35                                 throws IOException {
36                         throw new Error("Not supported.");
37                 }
38
39                 @Override
40                 public void serialize(DataOutput out, Object obj)
41                                 throws IOException {
42                         throw new Error("Not supported.");
43                 }
44
45                 @Override
46                 public Object deserialize(DataInput in, List<Object> identities)
47                                 throws IOException {
48                         throw new Error("Not supported.");
49                 }
50
51                 @Override
52                 public Object deserialize(DataInput in) throws IOException {
53                         throw new Error("Not supported.");
54                 }
55
56                 @Override
57                 public void deserializeTo(DataInput in, List<Object> identities,
58                                 Object obj) throws IOException {
59                         throw new Error("Not supported.");
60                 }
61
62                 @Override
63                 public void deserializeTo(DataInput in, Object obj)
64                                 throws IOException {
65                         throw new Error("Not supported.");
66                 }
67
68                 @Override
69                 public void skip(DataInput in, List<Object> identities)
70                                 throws IOException {
71                         throw new Error("Not supported.");
72                 }
73
74                 @Override
75                 public void skip(DataInput in) throws IOException {
76                         throw new Error("Not supported.");
77                 }
78
79                 @Override
80                 public Integer getConstantSize() {
81                         throw new Error("Not supported.");
82                 }
83
84                 @Override
85                 public int getSize(Object obj, TObjectIntHashMap<Object> identities)
86                                 throws IOException {
87                         throw new Error("Not supported.");
88                 }
89
90                 @Override
91                 public int getSize(Object obj) throws IOException {
92                         throw new Error("Not supported.");
93                 }
94
95                 @Override
96                 public int getMinSize() {
97                         throw new Error("Not supported.");
98                 }
99
100         };
101
102         @Override
103         public Serializer serializer() {
104                 return serializer;
105         }
106
107         @Override
108         public void accept(Visitor1 v, Object obj) {
109                 throw new Error("Not supported.");
110         }
111
112         @Override
113         public <T> T accept(Visitor<T> v) {
114                 throw new Error("Not supported.");
115         }
116
117         @Override
118         public boolean isInstance(Object obj) {
119                 throw new Error("Not supported.");
120         }
121
122         @Override
123         public void assertInstaceIsValid(Object obj, Set<Object> validInstances)
124                         throws org.simantics.databoard.binding.error.BindingException {
125                 throw new Error("Not supported.");
126         }
127
128         @Override
129         public int deepHashValue(Object value,
130                         IdentityHashMap<Object, Object> hashedObjects)
131                         throws org.simantics.databoard.binding.error.BindingException {
132                 throw new Error("Not supported.");
133         }
134
135         @Override
136         public int deepCompare(Object o1, Object o2,
137                         Set<IdentityPair<Object, Object>> compareHistory)
138                         throws org.simantics.databoard.binding.error.BindingException {
139                 throw new Error("Not supported.");
140         }
141
142         @Override
143         public void readFrom(Binding srcBinding, Object src, Object dst)
144                         throws org.simantics.databoard.binding.error.BindingException {
145                 throw new Error("Not supported.");
146         }
147
148         @Override
149         public Object readFromTry(Binding srcBinding, Object src, Object dst)
150                         throws org.simantics.databoard.binding.error.BindingException {
151                 throw new Error("Not supported.");
152         }
153
154         @Override
155         protected void toString(Object value, BindingPrintContext ctx) throws org.simantics.databoard.binding.error.BindingException {
156                 throw new Error("Not supported.");
157         }
158
159         @Override
160         public int getComponentCount() {
161                 throw new Error("Not supported.");
162         }
163
164         @Override
165         public Binding getComponentBinding(int index) {
166                 throw new Error("Not supported.");
167         }
168
169         @Override
170         public Binding getComponentBinding(ChildReference path) {
171                 throw new Error("Not supported.");
172         }
173
174 }