1 package org.simantics.db.layer0.variable;
\r
3 import java.util.Collection;
\r
4 import java.util.Set;
\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
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
22 public abstract class ProxyVariable implements Variable {
\r
24 protected final Variable proxy;
\r
25 protected final Variable parent;
\r
27 public ProxyVariable(Variable proxy, Variable parent) {
\r
29 throw new NullPointerException("null proxy");
\r
31 throw new NullPointerException("null parent");
\r
32 this.parent = parent;
\r
37 public <T> T getPropertyValue(ReadGraph graph, String name) throws DatabaseException {
\r
38 return proxy.getPropertyValue(graph, name);
\r
42 public <T> T getPropertyValue(ReadGraph graph, Resource property) throws DatabaseException {
\r
43 return proxy.getPropertyValue(graph, property);
\r
47 public <T> T getPossiblePropertyValue(ReadGraph graph, String name) throws DatabaseException {
\r
48 return proxy.getPossiblePropertyValue(graph, name);
\r
52 public <T> T getPossiblePropertyValue(ReadGraph graph, Resource property) throws DatabaseException {
\r
53 return proxy.getPossiblePropertyValue(graph, property);
\r
57 public <T> T getPropertyValue(ReadGraph graph, String name, Binding binding) throws DatabaseException {
\r
58 return proxy.getPropertyValue(graph, name, binding);
\r
62 public <T> T getPropertyValue(ReadGraph graph, Resource property, Binding binding) throws DatabaseException {
\r
63 return proxy.getPropertyValue(graph, property, binding);
\r
67 public <T> T getPossiblePropertyValue(ReadGraph graph, String name, Binding binding) throws DatabaseException {
\r
68 return proxy.getPossiblePropertyValue(graph, name, binding);
\r
72 public <T> T getPossiblePropertyValue(ReadGraph graph, Resource property, Binding binding) throws DatabaseException {
\r
73 return proxy.getPossiblePropertyValue(graph, property, binding);
\r
77 public <T> T getValue(ReadGraph graph) throws DatabaseException {
\r
78 return proxy.getValue(graph);
\r
82 public <T> T getPossibleValue(ReadGraph graph) throws DatabaseException {
\r
83 return proxy.getPossibleValue(graph);
\r
87 public <T> T getValue(ReadGraph graph, Binding binding) throws DatabaseException {
\r
88 return proxy.getValue(graph, binding);
\r
92 public <T> T getPossibleValue(ReadGraph graph, Binding binding) throws DatabaseException {
\r
93 return proxy.getPossibleValue(graph, binding);
\r
97 public void setValue(WriteGraph graph, Object value, Binding binding) throws DatabaseException {
\r
98 proxy.setValue(graph, value, binding);
\r
102 public void setValue(WriteGraph graph, Object value) throws DatabaseException {
\r
103 proxy.setValue(graph, value);
\r
107 public void setPropertyValue(WriteGraph graph, String name, Object value, Binding binding) throws DatabaseException {
\r
108 proxy.setPropertyValue(graph, name, value, binding);
\r
112 public void setPropertyValue(WriteGraph graph, Resource property, Object value, Binding binding) throws DatabaseException {
\r
113 proxy.setPropertyValue(graph, property, value, binding);
\r
117 public void setPropertyValue(WriteGraph graph, String name, Object value) throws DatabaseException {
\r
118 proxy.setPropertyValue(graph, name, value);
\r
122 public void setPropertyValue(WriteGraph graph, Resource property, Object value) throws DatabaseException {
\r
123 proxy.setPropertyValue(graph, property, value);
\r
127 public Variable getChild(ReadGraph graph, String name) throws DatabaseException {
\r
128 return proxy.getChild(graph, name);
\r
132 public Variable getPossibleChild(ReadGraph graph, String name) throws DatabaseException {
\r
133 return proxy.getPossibleChild(graph, name);
\r
137 public Variable getProperty(ReadGraph graph, String name) throws DatabaseException {
\r
138 return proxy.getProperty(graph, name);
\r
142 public Variable getProperty(ReadGraph graph, Resource property) throws DatabaseException {
\r
143 return proxy.getProperty(graph, property);
\r
147 public Variable getPossibleProperty(ReadGraph graph, String name) throws DatabaseException {
\r
148 return proxy.getPossibleProperty(graph, name);
\r
152 public Variable getPossibleProperty(ReadGraph graph, Resource property) throws DatabaseException {
\r
153 return proxy.getPossibleProperty(graph, property);
\r
157 public Collection<Variable> browseChildren(ReadGraph graph) throws DatabaseException {
\r
158 return proxy.browseChildren(graph);
\r
162 public Collection<Variable> getChildren(ReadGraph graph) throws DatabaseException {
\r
163 return proxy.getChildren(graph);
\r
167 public Collection<Variable> browseProperties(ReadGraph graph) throws DatabaseException {
\r
168 return proxy.browseProperties(graph);
\r
172 public Collection<Variable> getProperties(ReadGraph graph) throws DatabaseException {
\r
173 return proxy.getProperties(graph);
\r
177 public Collection<Variable> getProperties(ReadGraph graph, String classification) throws DatabaseException {
\r
178 return proxy.getProperties(graph, classification);
\r
182 public Collection<Variable> getProperties(ReadGraph graph, Resource classification) throws DatabaseException {
\r
183 return proxy.getProperties(graph, classification);
\r
187 public Variable browse(ReadGraph graph, String suffix) throws DatabaseException {
\r
188 if (suffix.isEmpty())
\r
190 return proxy.browse(graph, suffix);
\r
194 public Variable browsePossible(ReadGraph graph, String suffix) throws DatabaseException {
\r
195 if (suffix.isEmpty())
\r
197 return proxy.browsePossible(graph, suffix);
\r
201 public Variable browse(ReadGraph graph, Resource config) throws DatabaseException {
\r
202 return proxy.browse(graph, config);
\r
206 public Variable browsePossible(ReadGraph graph, Resource config) throws DatabaseException {
\r
207 return proxy.browsePossible(graph, config);
\r
211 public <T> T getInterface(ReadGraph graph, Class<T> clazz) throws DatabaseException {
\r
212 return proxy.getInterface(graph, clazz);
\r
216 public <T> T adapt(ReadGraph graph, Class<T> clazz) throws DatabaseException {
\r
217 return proxy.adapt(graph, clazz);
\r
221 public <T> T adaptPossible(ReadGraph graph, Class<T> clazz) throws DatabaseException {
\r
222 return proxy.adaptPossible(graph, clazz);
\r
226 public String getURI(ReadGraph graph) throws DatabaseException {
\r
227 return proxy.getURI(graph);
\r
231 public abstract int hashCode();
\r
234 public abstract boolean equals(Object obj);
\r
237 public Variable resolve(ReadGraph graph, RVIPart part) throws DatabaseException {
\r
238 return proxy.resolve(graph, part);
\r
242 public Variable resolvePossible(ReadGraph graph, RVIPart part) throws DatabaseException {
\r
243 return proxy.resolvePossible(graph, part);
\r
247 public String getName(ReadGraph graph) throws DatabaseException {
\r
248 return proxy.getName(graph);
\r
252 public String getLabel(ReadGraph graph) throws DatabaseException {
\r
253 return proxy.getLabel(graph);
\r
257 public Datatype getDatatype(ReadGraph graph) throws DatabaseException {
\r
258 return proxy.getDatatype(graph);
\r
262 public Datatype getPossibleDatatype(ReadGraph graph) throws DatabaseException {
\r
263 return proxy.getPossibleDatatype(graph);
\r
267 public Variable getPredicate(ReadGraph graph) throws DatabaseException {
\r
268 return proxy.getPredicate(graph);
\r
272 public Variable getPossiblePredicate(ReadGraph graph) throws DatabaseException {
\r
273 return proxy.getPossiblePredicate(graph);
\r
277 public Resource getPredicateResource(ReadGraph graph) throws DatabaseException {
\r
278 return proxy.getPredicateResource(graph);
\r
282 public Resource getPossiblePredicateResource(ReadGraph graph) throws DatabaseException {
\r
283 return proxy.getPossiblePredicateResource(graph);
\r
287 public Variable getParent(ReadGraph graph) throws DatabaseException {
\r
292 public Resource getRepresents(ReadGraph graph) throws DatabaseException {
\r
293 return proxy.getRepresents(graph);
\r
297 public Resource getPossibleRepresents(ReadGraph graph) throws DatabaseException {
\r
298 return proxy.getPossibleRepresents(graph);
\r
302 public Resource getType(ReadGraph graph) throws DatabaseException {
\r
303 return proxy.getType(graph);
\r
307 public Resource getPossibleType(ReadGraph graph) throws DatabaseException {
\r
308 return proxy.getPossibleType(graph);
\r
312 public RVI getRVI(ReadGraph graph) throws DatabaseException {
\r
313 return proxy.getRVI(graph);
\r
317 public RVI getPossibleRVI(ReadGraph graph) throws DatabaseException {
\r
318 return proxy.getPossibleRVI(graph);
\r
322 public Set<String> getClassifications(ReadGraph graph) throws DatabaseException {
\r
323 return proxy.getClassifications(graph);
\r
326 public Variant getVariantValue(ReadGraph graph) throws DatabaseException {
\r
327 return proxy.getVariantValue(graph);
\r
331 public Resource getType(ReadGraph graph, Resource baseType) throws DatabaseException {
\r
332 return proxy.getType(graph, baseType);
\r
336 public Resource getPossibleType(ReadGraph graph, Resource baseType) throws DatabaseException {
\r
337 return proxy.getPossibleType(graph, baseType);
\r