Fix checkstyle violations in yang-binding
[mdsal.git] / binding / yang-binding / src / main / java / org / opendaylight / yangtools / yang / binding / DataObjectSerializerImplementation.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 import java.io.IOException;
11
12 /**
13  * SPI-level contract for implementations of {@link DataObjectSerializer}.
14  * The contract is kept between implementation of {@link DataObjectSerializerRegistry},
15  * which maintains the lookup context required for recursive serialization.
16  */
17 /*
18  * FIXME: this interface needs to be moved into .spi, but due to classpath funkyness
19  *        of OSGi, that change has to be carefully orchestrated to ensure proper imports
20  *        exist in all generated packages. One avenue how to achieve that is to move
21  *        {@link YangModuleInfo} and modify code generator to add a static field
22  *        to all generated classes which will point to the per-model YangModuleInfo
23  *        (currently all users of it have to walk the package hierarchy, so that
24  *        is an improvement in and of itself).
25  */
26 public interface DataObjectSerializerImplementation {
27     /**
28      * Writes stream events for supplied data object to provided stream.
29      *
30      * <p>
31      * DataObjectSerializerRegistry may be used to lookup serializers for other generated classes  in order to support
32      * writing their events.
33      */
34     void serialize(DataObjectSerializerRegistry reg, DataObject obj, BindingStreamEventWriter stream)
35             throws IOException;
36 }