]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardVariableBuilder.java
Check if root allows paste only for non-null target root to prevent NPE
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / variable / StandardVariableBuilder.java
1 package org.simantics.db.layer0.variable;
2
3 import org.simantics.db.ReadGraph;
4 import org.simantics.db.Resource;
5 import org.simantics.db.exception.DatabaseException;
6
7 public class StandardVariableBuilder<Node> implements VariableBuilder<Node> {
8
9         @Override
10         public Variable buildChild(ReadGraph graph, Variable parent, VariableNode<Node> node, Resource child) {
11                 return new StandardGraphChildVariable(parent, node, child);
12         }
13
14         @Override
15         public Variable buildProperty(ReadGraph graph, Variable parent, VariableNode<Node> node, Resource subject, Resource predicate) throws DatabaseException {
16                 return new StandardGraphPropertyVariable(graph, parent, node, subject, predicate);
17         }
18
19 }