]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/MappingSchemas.java
Support for linked lists in objmap2.
[simantics/platform.git] / bundles / org.simantics.objmap2 / src / org / simantics / objmap / graph / schema / MappingSchemas.java
index 56aa5da205ed21fb0cde31f9e3fd325d18a0a7f3..cf2f3bf45065c5bee4951da094d67b8e94686767 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2013 Association for Decentralized Information Management in
+ * Copyright (c) 2012, 2013, 2019 Association for Decentralized Information Management in
  * Industry THTH ry.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,7 @@
  *
  * Contributors:
  *     VTT Technical Research Centre of Finland - initial API and implementation
+ *     Semantum oy - linked list mapping API and implementation
  *******************************************************************************/
 package org.simantics.objmap.graph.schema;
 
@@ -27,6 +28,8 @@ import org.simantics.objmap.graph.annotations.GraphType;
 import org.simantics.objmap.graph.annotations.HasCollectionAdder;
 import org.simantics.objmap.graph.annotations.HasCollectionRemover;
 import org.simantics.objmap.graph.annotations.HasSetter;
+import org.simantics.objmap.graph.annotations.LinkedListGet;
+import org.simantics.objmap.graph.annotations.LinkedList;
 import org.simantics.objmap.graph.annotations.OptionalRelatedElements;
 import org.simantics.objmap.graph.annotations.OrderedElementsGet;
 import org.simantics.objmap.graph.annotations.OrderedSetType;
@@ -39,6 +42,8 @@ import org.simantics.objmap.graph.annotations.RelatedOrderedSetElements;
 import org.simantics.objmap.graph.annotations.RelatedValue;
 import org.simantics.objmap.graph.annotations.UpdateMethod;
 import org.simantics.objmap.graph.annotations.factories.CompoundRelatedGetSetValueRuleFactory;
+import org.simantics.objmap.graph.annotations.factories.LinkedListRuleFactory;
+import org.simantics.objmap.graph.annotations.factories.LinkedListRuleFactory2;
 import org.simantics.objmap.graph.annotations.factories.OptionalRelatedElementsRuleFactory;
 import org.simantics.objmap.graph.annotations.factories.OrderedElementsRuleFactory;
 import org.simantics.objmap.graph.annotations.factories.RelatedElementRuleFactory;
@@ -240,6 +245,8 @@ public class MappingSchemas {
             return new OptionalRelatedElementsRuleFactory<Object>();
         if (annotation.annotationType().equals(RelatedOrderedSetElements.class))
             return new RelatedOrderedSetElementsRuleFactory<Object>();
+        if (annotation.annotationType().equals(LinkedList.class))
+            return new LinkedListRuleFactory<Object>();
         return null;
     }
 
@@ -264,6 +271,8 @@ public class MappingSchemas {
             return new RelatedElementsRuleFactory2<Object>();
         if (annotation.annotationType().equals(OrderedElementsGet.class))
             return new OrderedElementsRuleFactory<Object>();
+        if (annotation.annotationType().equals(LinkedListGet.class))
+            return new LinkedListRuleFactory2<>();
         return null;
     }