BUG-1487: use prototypes for instantiating codecs
[mdsal.git] / code-generator / binding-data-codec / src / main / java / org / opendaylight / yangtools / binding / data / codec / gen / impl / DataObjectSerializerGenerator.java
diff --git a/code-generator/binding-data-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/gen/impl/DataObjectSerializerGenerator.java b/code-generator/binding-data-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/gen/impl/DataObjectSerializerGenerator.java
new file mode 100644 (file)
index 0000000..7ec766c
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. 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.yangtools.binding.data.codec.gen.impl;
+
+import org.opendaylight.yangtools.sal.binding.generator.util.BindingRuntimeContext;
+import org.opendaylight.yangtools.yang.binding.DataObjectSerializerImplementation;
+
+/**
+ * Public interface exposed from generator implementation.
+ */
+public interface DataObjectSerializerGenerator {
+    /**
+     * Get a serializer for a particular type.
+     *
+     * @param type Type class
+     * @return Serializer instance.
+     */
+    DataObjectSerializerImplementation getSerializer(Class<?> type);
+
+    /**
+     * Notify the generator that the runtime context has been updated.
+     * @param runtime New runtime context
+     */
+    void onBindingRuntimeContextUpdated(BindingRuntimeContext runtime);
+}