Mark DataContainerCodecPrototype.isChoice() for removal
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / codec / impl / NodeCodecContext.java
index c89fdf72b5de9bfa4d90190aeaa237d210217984..2c2429130cbacc65aebbabec7b9c538957d9cb2a 100644 (file)
@@ -8,11 +8,13 @@
 package org.opendaylight.mdsal.binding.dom.codec.impl;
 
 import com.google.common.collect.ImmutableMap;
+import java.lang.reflect.Method;
 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.generator.util.BindingRuntimeContext;
-import org.opendaylight.yangtools.yang.binding.DataObjectSerializer;
+import org.opendaylight.mdsal.binding.dom.codec.loader.CodecClassLoader;
+import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeContext;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
@@ -26,14 +28,13 @@ import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
  * <p>
  * Two core subtypes of codec context are available:
  * <ul>
- * <li>{@link LeafNodeCodecContext} - Context for nodes, which does not contain any nested YANG modeled substructures.
+ * <li>{@link ValueNodeCodecContext} - Context for nodes, which does not contain any nested YANG modeled substructures.
  * </li>
  * <li>{@link DataObjectCodecContext} - Context for nodes, which does contain nested YANG modeled substructures. This
  * context nodes contains context for children nodes.</li>
  * </ul>
  */
 abstract class NodeCodecContext implements BindingCodecTreeNode {
-
     /**
      * Returns Yang Instance Identifier Path Argument of current node.
      *
@@ -63,7 +64,7 @@ abstract class NodeCodecContext implements BindingCodecTreeNode {
          * @param schema  Instantiated schema of binding type.
          * @return Map of local name to leaf node context.
          */
-        ImmutableMap<String, LeafNodeCodecContext> getLeafNodes(Class<?> type, DataNodeContainer schema);
+        ImmutableMap<Method, ValueNodeCodecContext> getLeafNodes(Class<?> type, DataNodeContainer schema);
 
         /**
          * Returns Path argument codec for list item.
@@ -74,6 +75,15 @@ abstract class NodeCodecContext implements BindingCodecTreeNode {
          */
         IdentifiableItemCodec getPathArgumentCodec(Class<?> type, ListSchemaNode schema);
 
+        /**
+         * Return the codec loader associated with this factory.
+         *
+         * @return A codec loader instance
+         */
+        @NonNull CodecClassLoader getLoader();
+
+        @NonNull DataObjectStreamer<?> getDataObjectSerializer(Class<?> type);
+
         DataObjectSerializer getEventStreamSerializer(Class<?> type);
     }
 
@@ -100,5 +110,5 @@ abstract class NodeCodecContext implements BindingCodecTreeNode {
         return null;
     }
 
-    protected abstract Object deserializeObject(NormalizedNode<?, ?> normalizedNode);
+    protected abstract Object deserializeObject(NormalizedNode normalizedNode);
 }