3c6a74b3b670622fa529ea1b83ad5e3b787bf0d5
[mdsal.git] / yang / yang-binding / src / main / java / org / opendaylight / yangtools / yang / binding / DataObjectSerializerRegistry.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.binding;
9
10 /**
11  * SPI-level contract for registry of {@link DataObjectSerializer}.
12  * The contract is kept between implementation of {@link DataObjectSerializerImplementation},
13  * Registry provides lookup for serializers to support recursive
14  * serialization of nested {@link DataObject}s.
15  *
16  * FIXME: this interface needs to be moved into .spi, but due to classpath funkyness
17  *        of OSGi, that change has to be carefully orchestrated to ensure proper imports
18  *        exist in all generated pacakges. One avenue how to achieve that is to move
19  *        {@link YangModuleInfo} and modify code generator to add a static field
20  *        to all generated classes which will point to the per-model YangModuleInfo
21  *        (currently all users of it have to walk the package hierarchy, so that
22  *        is an improvement in and of itself).
23  *
24  */
25 public interface DataObjectSerializerRegistry {
26
27     DataObjectSerializer getSerializer(Class<? extends DataObject> binding);
28
29 }