Abstract infrastructure for normalized nodes translation.
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / transform / FromNormalizedNodeSerializer.java
1 /*
2  * Copyright (c) 2013 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.data.impl.schema.transform;
9
10 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
11
12 /**
13  *
14  * Generic serializer for normalized nodes. NormalizedNodes can be serialized
15  * e.g. to Dom APIs.
16  *
17  * @param <E>
18  *            type of resulting/serialized element from NormalizedNode
19  * @param <N>
20  *            type of NormalizedNode to be serialized
21  * @param <S>
22  *            schema belonging to the type N of NormalizedNode
23  */
24 public interface FromNormalizedNodeSerializer<E, N extends NormalizedNode<?, ?>, S> {
25
26     /**
27      *
28      * Serialize one node of type N as a list of E elements. If the serialization
29      * process creates only one E element as a result e.g. container node, the
30      * result element is expected to be wrapped in a list.
31      *
32      * @param schema
33      * @param node
34      * @return Serialized N node as a list of E elements
35      */
36     Iterable<E> serialize(S schema, N node);
37 }