]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ProxyVariable.java
Merge commit 'ad8333027322fda6b9a8a524c7a7e15a54c52f38'
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / variable / ProxyVariable.java
1 package org.simantics.db.layer0.variable;\r
2 \r
3 import java.util.Collection;\r
4 import java.util.Set;\r
5 \r
6 import org.simantics.databoard.binding.Binding;\r
7 import org.simantics.databoard.binding.mutable.Variant;\r
8 import org.simantics.databoard.type.Datatype;\r
9 import org.simantics.db.ReadGraph;\r
10 import org.simantics.db.Resource;\r
11 import org.simantics.db.WriteGraph;\r
12 import org.simantics.db.exception.DatabaseException;\r
13 import org.simantics.db.layer0.variable.RVI.RVIPart;\r
14 \r
15 /**\r
16  * @deprecated this implementation is pretty much useless, it is too\r
17  *             straightforward and requires extenders to override pretty much\r
18  *             everything in it to work correctly. Do not use.\r
19  * @see ValueProxyVariable\r
20  */\r
21 @Deprecated\r
22 public abstract class ProxyVariable implements Variable {\r
23 \r
24     protected final Variable proxy;\r
25     protected final Variable parent;\r
26 \r
27     public ProxyVariable(Variable proxy, Variable parent) {\r
28         if (proxy == null)\r
29             throw new NullPointerException("null proxy");\r
30         if (parent == null)\r
31             throw new NullPointerException("null parent");\r
32         this.parent = parent;\r
33         this.proxy = proxy;\r
34     }\r
35 \r
36     @Override\r
37     public <T> T getPropertyValue(ReadGraph graph, String name) throws DatabaseException {\r
38         return proxy.getPropertyValue(graph, name);\r
39     }\r
40 \r
41     @Override\r
42     public <T> T getPropertyValue(ReadGraph graph, Resource property) throws DatabaseException {\r
43         return proxy.getPropertyValue(graph, property);\r
44     }\r
45 \r
46     @Override\r
47     public <T> T getPossiblePropertyValue(ReadGraph graph, String name) throws DatabaseException {\r
48         return proxy.getPossiblePropertyValue(graph, name);\r
49     }\r
50 \r
51     @Override\r
52     public <T> T getPossiblePropertyValue(ReadGraph graph, Resource property) throws DatabaseException {\r
53         return proxy.getPossiblePropertyValue(graph, property);\r
54     }\r
55 \r
56     @Override\r
57     public <T> T getPropertyValue(ReadGraph graph, String name, Binding binding) throws DatabaseException {\r
58         return proxy.getPropertyValue(graph, name, binding);\r
59     }\r
60 \r
61     @Override\r
62     public <T> T getPropertyValue(ReadGraph graph, Resource property, Binding binding) throws DatabaseException {\r
63         return proxy.getPropertyValue(graph, property, binding);\r
64     }\r
65 \r
66     @Override\r
67     public <T> T getPossiblePropertyValue(ReadGraph graph, String name, Binding binding) throws DatabaseException {\r
68         return proxy.getPossiblePropertyValue(graph, name, binding);\r
69     }\r
70 \r
71     @Override\r
72     public <T> T getPossiblePropertyValue(ReadGraph graph, Resource property, Binding binding) throws DatabaseException {\r
73         return proxy.getPossiblePropertyValue(graph, property, binding);\r
74     }\r
75 \r
76     @Override\r
77     public <T> T getValue(ReadGraph graph) throws DatabaseException {\r
78         return proxy.getValue(graph);\r
79     }\r
80 \r
81     @Override\r
82     public <T> T getPossibleValue(ReadGraph graph) throws DatabaseException {\r
83         return proxy.getPossibleValue(graph);\r
84     }\r
85 \r
86     @Override\r
87     public <T> T getValue(ReadGraph graph, Binding binding) throws DatabaseException {\r
88         return proxy.getValue(graph, binding);\r
89     }\r
90 \r
91     @Override\r
92     public <T> T getPossibleValue(ReadGraph graph, Binding binding) throws DatabaseException {\r
93         return proxy.getPossibleValue(graph, binding);\r
94     }\r
95 \r
96     @Override\r
97     public void setValue(WriteGraph graph, Object value, Binding binding) throws DatabaseException {\r
98         proxy.setValue(graph, value, binding);\r
99     }\r
100 \r
101     @Override\r
102     public void setValue(WriteGraph graph, Object value) throws DatabaseException {\r
103         proxy.setValue(graph, value);\r
104     }\r
105 \r
106     @Override\r
107     public void setPropertyValue(WriteGraph graph, String name, Object value, Binding binding) throws DatabaseException {\r
108         proxy.setPropertyValue(graph, name, value, binding);\r
109     }\r
110 \r
111     @Override\r
112     public void setPropertyValue(WriteGraph graph, Resource property, Object value, Binding binding) throws DatabaseException {\r
113         proxy.setPropertyValue(graph, property, value, binding);\r
114     }\r
115 \r
116     @Override\r
117     public void setPropertyValue(WriteGraph graph, String name, Object value) throws DatabaseException {\r
118         proxy.setPropertyValue(graph, name, value);\r
119     }\r
120 \r
121     @Override\r
122     public void setPropertyValue(WriteGraph graph, Resource property, Object value) throws DatabaseException {\r
123         proxy.setPropertyValue(graph, property, value);\r
124     }\r
125 \r
126     @Override\r
127     public Variable getChild(ReadGraph graph, String name) throws DatabaseException {\r
128         return proxy.getChild(graph, name);\r
129     }\r
130 \r
131     @Override\r
132     public Variable getPossibleChild(ReadGraph graph, String name) throws DatabaseException {\r
133         return proxy.getPossibleChild(graph, name);\r
134     }\r
135 \r
136     @Override\r
137     public Variable getProperty(ReadGraph graph, String name) throws DatabaseException {\r
138         return proxy.getProperty(graph, name);\r
139     }\r
140 \r
141     @Override\r
142     public Variable getProperty(ReadGraph graph, Resource property) throws DatabaseException {\r
143         return proxy.getProperty(graph, property);\r
144     }\r
145 \r
146     @Override\r
147     public Variable getPossibleProperty(ReadGraph graph, String name) throws DatabaseException {\r
148         return proxy.getPossibleProperty(graph, name);\r
149     }\r
150 \r
151     @Override\r
152     public Variable getPossibleProperty(ReadGraph graph, Resource property) throws DatabaseException {\r
153         return proxy.getPossibleProperty(graph, property);\r
154     }\r
155 \r
156     @Override\r
157     public Collection<Variable> browseChildren(ReadGraph graph) throws DatabaseException {\r
158         return proxy.browseChildren(graph);\r
159     }\r
160 \r
161     @Override\r
162     public Collection<Variable> getChildren(ReadGraph graph) throws DatabaseException {\r
163         return proxy.getChildren(graph);\r
164     }\r
165 \r
166     @Override\r
167     public Collection<Variable> browseProperties(ReadGraph graph) throws DatabaseException {\r
168         return proxy.browseProperties(graph);\r
169     }\r
170 \r
171     @Override\r
172     public Collection<Variable> getProperties(ReadGraph graph) throws DatabaseException {\r
173         return proxy.getProperties(graph);\r
174     }\r
175 \r
176     @Override\r
177     public Collection<Variable> getProperties(ReadGraph graph, String classification) throws DatabaseException {\r
178         return proxy.getProperties(graph, classification);\r
179     }\r
180 \r
181     @Override\r
182     public Collection<Variable> getProperties(ReadGraph graph, Resource classification) throws DatabaseException {\r
183         return proxy.getProperties(graph, classification);\r
184     }\r
185 \r
186     @Override\r
187     public Variable browse(ReadGraph graph, String suffix) throws DatabaseException {\r
188         if (suffix.isEmpty())\r
189             return this;\r
190         return proxy.browse(graph, suffix);\r
191     }\r
192 \r
193     @Override\r
194     public Variable browsePossible(ReadGraph graph, String suffix) throws DatabaseException {\r
195         if (suffix.isEmpty())\r
196             return this;\r
197         return proxy.browsePossible(graph, suffix);\r
198     }\r
199 \r
200     @Override\r
201     public Variable browse(ReadGraph graph, Resource config) throws DatabaseException {\r
202         return proxy.browse(graph, config);\r
203     }\r
204 \r
205     @Override\r
206     public Variable browsePossible(ReadGraph graph, Resource config) throws DatabaseException {\r
207         return proxy.browsePossible(graph, config);\r
208     }\r
209 \r
210     @Override\r
211     public <T> T getInterface(ReadGraph graph, Class<T> clazz) throws DatabaseException {\r
212         return proxy.getInterface(graph, clazz);\r
213     }\r
214 \r
215     @Override\r
216     public <T> T adapt(ReadGraph graph, Class<T> clazz) throws DatabaseException {\r
217         return proxy.adapt(graph, clazz);\r
218     }\r
219 \r
220     @Override\r
221     public <T> T adaptPossible(ReadGraph graph, Class<T> clazz) throws DatabaseException {\r
222         return proxy.adaptPossible(graph, clazz);\r
223     }\r
224 \r
225     @Override\r
226     public String getURI(ReadGraph graph) throws DatabaseException {\r
227         return proxy.getURI(graph);\r
228     }\r
229 \r
230     @Override\r
231     public abstract int hashCode();\r
232 \r
233     @Override\r
234     public abstract boolean equals(Object obj);\r
235 \r
236     @Override\r
237     public Variable resolve(ReadGraph graph, RVIPart part) throws DatabaseException {\r
238         return proxy.resolve(graph, part);\r
239     }\r
240 \r
241     @Override\r
242     public Variable resolvePossible(ReadGraph graph, RVIPart part) throws DatabaseException {\r
243         return proxy.resolvePossible(graph, part);\r
244     }\r
245 \r
246     @Override\r
247     public String getName(ReadGraph graph) throws DatabaseException {\r
248         return proxy.getName(graph);\r
249     }\r
250 \r
251     @Override\r
252     public String getLabel(ReadGraph graph) throws DatabaseException {\r
253         return proxy.getLabel(graph);\r
254     }\r
255 \r
256     @Override\r
257     public Datatype getDatatype(ReadGraph graph) throws DatabaseException {\r
258         return proxy.getDatatype(graph);\r
259     }\r
260 \r
261     @Override\r
262     public Datatype getPossibleDatatype(ReadGraph graph) throws DatabaseException {\r
263         return proxy.getPossibleDatatype(graph);\r
264     }\r
265 \r
266     @Override\r
267     public Variable getPredicate(ReadGraph graph) throws DatabaseException {\r
268         return proxy.getPredicate(graph);\r
269     }\r
270 \r
271     @Override\r
272     public Variable getPossiblePredicate(ReadGraph graph) throws DatabaseException {\r
273         return proxy.getPossiblePredicate(graph);\r
274     }\r
275 \r
276     @Override\r
277     public Resource getPredicateResource(ReadGraph graph) throws DatabaseException {\r
278         return proxy.getPredicateResource(graph);\r
279     }\r
280 \r
281     @Override\r
282     public Resource getPossiblePredicateResource(ReadGraph graph) throws DatabaseException {\r
283         return proxy.getPossiblePredicateResource(graph);\r
284     }\r
285     \r
286     @Override\r
287     public Variable getParent(ReadGraph graph) throws DatabaseException {\r
288         return parent;\r
289     }\r
290 \r
291     @Override\r
292     public Resource getRepresents(ReadGraph graph) throws DatabaseException {\r
293         return proxy.getRepresents(graph);\r
294     }\r
295 \r
296     @Override\r
297     public Resource getPossibleRepresents(ReadGraph graph) throws DatabaseException {\r
298         return proxy.getPossibleRepresents(graph);\r
299     }\r
300 \r
301     @Override\r
302     public Resource getType(ReadGraph graph) throws DatabaseException {\r
303         return proxy.getType(graph);\r
304     }\r
305 \r
306     @Override\r
307     public Resource getPossibleType(ReadGraph graph) throws DatabaseException {\r
308         return proxy.getPossibleType(graph);\r
309     }\r
310 \r
311     @Override\r
312     public RVI getRVI(ReadGraph graph) throws DatabaseException {\r
313         return proxy.getRVI(graph);\r
314     }\r
315 \r
316     @Override\r
317     public RVI getPossibleRVI(ReadGraph graph) throws DatabaseException {\r
318         return proxy.getPossibleRVI(graph);\r
319     }\r
320 \r
321     @Override\r
322     public Set<String> getClassifications(ReadGraph graph) throws DatabaseException {\r
323         return proxy.getClassifications(graph);\r
324     }\r
325 \r
326     public Variant getVariantValue(ReadGraph graph) throws DatabaseException {\r
327         return proxy.getVariantValue(graph);\r
328     }\r
329 \r
330         @Override\r
331         public Resource getType(ReadGraph graph, Resource baseType) throws DatabaseException {\r
332                 return proxy.getType(graph, baseType);\r
333         }\r
334 \r
335         @Override\r
336         public Resource getPossibleType(ReadGraph graph, Resource baseType) throws DatabaseException {\r
337                 return proxy.getPossibleType(graph, baseType);\r
338         }\r
339 }