2 * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.binding.javav2.dom.codec.generator.impl;
10 import com.google.common.annotations.Beta;
11 import java.io.IOException;
12 import org.opendaylight.mdsal.binding.javav2.spec.base.TreeNode;
13 import org.opendaylight.mdsal.binding.javav2.spec.runtime.BindingStreamEventWriter;
14 import org.opendaylight.mdsal.binding.javav2.spec.runtime.TreeNodeSerializerImplementation;
15 import org.opendaylight.mdsal.binding.javav2.spec.runtime.TreeNodeSerializerRegistry;
18 * Prototype of a TreeNodeSerializerImplementation. This is a template class, which the stream writer
19 * generator uses to instantiate {@link TreeNodeSerializerImplementation} on a per-type basis. During that
20 * time, the {@link #serialize(TreeNodeSerializerRegistry, TreeNode, BindingStreamEventWriter)} method will be
21 * replaced by the real implementation.
24 public final class TreeNodeSerializerPrototype implements TreeNodeSerializerImplementation {
26 private static final TreeNodeSerializerPrototype INSTANCE = new TreeNodeSerializerPrototype();
28 private TreeNodeSerializerPrototype() {
29 // Intentionally hidden, subclasses can replace it
33 * Return the shared serializer instance.
35 * @return Global singleton instance.
37 public static TreeNodeSerializerPrototype getInstance() {
42 public void serialize(final TreeNodeSerializerRegistry reg, final TreeNode obj,
43 final BindingStreamEventWriter stream) throws IOException {
44 throw new UnsupportedOperationException("Prototype body, this code should never be invoked.");