Binding v2 DOM Codec - generator - API 42/58442/2
authorJakub Toth <jakub.toth@pantheon.tech>
Mon, 5 Jun 2017 13:32:39 +0000 (15:32 +0200)
committerMartin Ciglan <martin.ciglan@pantheon.tech>
Thu, 8 Jun 2017 05:56:17 +0000 (05:56 +0000)
  * api for getting serializer fo specific type

Change-Id: I04288cf4d514193a1bae363781a29517cf5adb2f
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
(cherry picked from commit c9ab5d69eb5f533fb9e41270d046f903c0d38690)

binding2/mdsal-binding2-dom-codec/src/main/java/org/opendaylight/mdsal/binding/javav2/dom/codec/generator/api/TreeNodeSerializerGenerator.java [new file with mode: 0644]

diff --git a/binding2/mdsal-binding2-dom-codec/src/main/java/org/opendaylight/mdsal/binding/javav2/dom/codec/generator/api/TreeNodeSerializerGenerator.java b/binding2/mdsal-binding2-dom-codec/src/main/java/org/opendaylight/mdsal/binding/javav2/dom/codec/generator/api/TreeNodeSerializerGenerator.java
new file mode 100644 (file)
index 0000000..3f77ead
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.mdsal.binding.javav2.dom.codec.generator.api;
+
+import com.google.common.annotations.Beta;
+import org.opendaylight.mdsal.binding.javav2.generator.impl.util.BindingRuntimeContext;
+import org.opendaylight.mdsal.binding.javav2.spec.runtime.TreeNodeSerializerImplementation;
+
+/**
+ * Public interface exposed from generator implementation.
+ */
+@Beta
+public interface TreeNodeSerializerGenerator {
+
+    /**
+     * Get a serializer for a particular type.
+     *
+     * @param type - class of type
+     * @return serializer instance
+     */
+    TreeNodeSerializerImplementation getSerializer(Class<?> type);
+
+    /**
+     * Notify the generator that the runtime context has been updated.
+     *
+     * @param runtime - new runtime context
+     */
+    void onBindingRuntimeContextUpdated(BindingRuntimeContext runtime);
+}