Refactor DataObjectCodecContext.getBindingChildValue()
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / codec / impl / NodeCodecContext.java
index 3311ae59de63a11fb1fe65a7e3e6d05cf9267d1c..868aa3a804b12f65b64e57ca3f133c8612fe9315 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.mdsal.binding.dom.codec.impl;
 
 import com.google.common.collect.ImmutableMap;
 import java.util.List;
+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.concepts.Codec;
@@ -94,5 +95,15 @@ abstract class NodeCodecContext<D extends DataObject> implements BindingCodecTre
         }
     }
 
+    /**
+     * Return the default value object. Implementations of this method are explicitly allowed to throw unchecked
+     * exceptions, which are propagated as-is upwards the stack.
+     *
+     * @return The default value object, or null if the default value is not defined.
+     */
+    @Nullable Object defaultObject() {
+        return null;
+    }
+
     protected abstract Object deserializeObject(NormalizedNode<?, ?> normalizedNode);
 }