]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/templates/BuiltinTemplates.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.graph.compiler / src / org / simantics / graph / compiler / internal / templates / BuiltinTemplates.java
diff --git a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/templates/BuiltinTemplates.java b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/templates/BuiltinTemplates.java
new file mode 100644 (file)
index 0000000..860be2c
--- /dev/null
@@ -0,0 +1,26 @@
+package org.simantics.graph.compiler.internal.templates;\r
+\r
+import gnu.trove.map.hash.THashMap;\r
+\r
+import org.simantics.graph.query.Path;\r
+import org.simantics.graph.query.PathChild;\r
+import org.simantics.graph.query.Paths;\r
+\r
+\r
+public class BuiltinTemplates {        \r
+       public final THashMap<Path, ITemplate> TEMPLATES = \r
+               new THashMap<Path, ITemplate>();\r
+       \r
+       public void add(Path path, ITemplate template) {\r
+               TEMPLATES.put(path, template);\r
+       }\r
+       \r
+       public BuiltinTemplates(Paths paths) {\r
+               add(new PathChild("new", paths.Layer0), NewTemplate.INSTANCE);\r
+               add(new PathChild("list", paths.Layer0), ListTemplate.INSTANCE);\r
+               add(new PathChild("orderedSet", paths.Layer0), OrderedSetTemplate.INSTANCE);\r
+               add(new PathChild("loadBytes", paths.Layer0), LoadBytesTemplate.INSTANCE);\r
+               add(new PathChild("loadString", paths.Layer0), LoadStringTemplate.INSTANCE);\r
+               add(new PathChild("loadDataValue", paths.Layer0), LoadDataValueTemplate.INSTANCE);\r
+       }\r
+}\r