Convert mdsal-binding-dom-codec to a JPMS module
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / codec / impl / NodeCodecContext.java
index 61b26a42be486e24385bf30afcdf51242f50eff0..f4ac5d8c63d4fffcb7cabe30055fa6f658f553a1 100644 (file)
@@ -13,14 +13,13 @@ import java.util.List;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeNode;
-import org.opendaylight.mdsal.binding.dom.codec.loader.CodecClassLoader;
-import org.opendaylight.mdsal.binding.generator.util.BindingRuntimeContext;
-import org.opendaylight.yangtools.yang.binding.DataObjectSerializer;
+import org.opendaylight.mdsal.binding.dom.codec.impl.loader.CodecClassLoader;
+import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeContext;
+import org.opendaylight.mdsal.binding.runtime.api.ListRuntimeType;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
-import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 
 /**
  * Location specific context for schema nodes, which contains codec specific information to properly serialize
@@ -36,18 +35,6 @@ import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
  * </ul>
  */
 abstract class NodeCodecContext implements BindingCodecTreeNode {
-    /**
-     * Transition runtime constant to allow choosing between legacy mutable lists and immutable lists.
-     */
-    // FIXME: 5.0.0: MDSAL-446: remove this knob completely
-    static final boolean COMPAT_MUTABLE_LISTS;
-
-    static {
-        final String propVal = System.getProperty("org.opendaylight.mdsal.binding.dom.codec.impl.compat-mutable-lists");
-        // FIXME: 5.0.0: MDSAL-446: if not above, flip the default to opt-out
-        COMPAT_MUTABLE_LISTS = propVal == null ? true : Boolean.parseBoolean(propVal);
-    }
-
     /**
      * Returns Yang Instance Identifier Path Argument of current node.
      *
@@ -77,16 +64,16 @@ abstract class NodeCodecContext implements BindingCodecTreeNode {
          * @param schema  Instantiated schema of binding type.
          * @return Map of local name to leaf node context.
          */
-        ImmutableMap<Method, ValueNodeCodecContext> getLeafNodes(Class<?> type, DataNodeContainer schema);
+        ImmutableMap<Method, ValueNodeCodecContext> getLeafNodes(Class<?> type, EffectiveStatement<?, ?> schema);
 
         /**
          * Returns Path argument codec for list item.
          *
-         * @param type Type of list item
-         * @param schema Schema of list item
+         * @param listClz Type of list item
+         * @param type Schema of list item
          * @return Path argument codec for supplied list item.
          */
-        IdentifiableItemCodec getPathArgumentCodec(Class<?> type, ListSchemaNode schema);
+        IdentifiableItemCodec getPathArgumentCodec(Class<?> listClz, ListRuntimeType type);
 
         /**
          * Return the codec loader associated with this factory.
@@ -123,5 +110,5 @@ abstract class NodeCodecContext implements BindingCodecTreeNode {
         return null;
     }
 
-    protected abstract Object deserializeObject(NormalizedNode<?, ?> normalizedNode);
+    protected abstract Object deserializeObject(NormalizedNode normalizedNode);
 }