Binding2 runtime - Codecs impl - writers
[mdsal.git] / binding2 / mdsal-binding2-dom-codec / src / main / java / org / opendaylight / mdsal / binding / javav2 / dom / codec / impl / serializer / NormalizedNodeWithAddChildWriter.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. 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.mdsal.binding.javav2.dom.codec.impl.serializer;
9
10 import com.google.common.annotations.Beta;
11 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
12 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter;
13 import org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResult;
14
15 /**
16  * Event Stream Writer based on Normalized Node tree representation with
17  * allowing to add children.
18  *
19  */
20 @Beta
21 final class NormalizedNodeWithAddChildWriter extends ImmutableNormalizedNodeStreamWriter {
22
23     /**
24      * Initialization writer based on {@link NormalizedNodeResult}.
25      *
26      * @param result
27      *            - result holder for writer
28      */
29     NormalizedNodeWithAddChildWriter(final NormalizedNodeResult result) {
30         super(result);
31     }
32
33     void addChild(final NormalizedNode<?, ?> child) {
34         this.writeChild(child);
35     }
36 }