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