Populate parser/ hierarchy
[yangtools.git] / data / rfc8528-data-api / src / main / java / org / opendaylight / yangtools / rfc8528 / data / api / StreamWriterMountPointExtension.java
1 /*
2  * Copyright (c) 2019 PANTHEON.tech 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.yangtools.rfc8528.data.api;
9
10 import com.google.common.annotations.Beta;
11 import java.io.IOException;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
14 import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriterExtension;
15
16 /**
17  * A {@link NormalizedNodeStreamWriterExtension} exposed by stream writers which can handle mount point data, notably
18  * providing the facilities to resolve a mount point schema and normalize mount point contents into a normalized
19  * structure.
20  */
21 @Beta
22 @NonNullByDefault
23 public interface StreamWriterMountPointExtension extends NormalizedNodeStreamWriterExtension {
24     /**
25      * Start a new mount point with a specific mount point context. The returned writer will be used to emit the content
26      * of the mount point, without touching the writer to which this extension is attached to. Once that is done, the
27      * returned writer will be {@link NormalizedNodeStreamWriter#close()}d, at which point the parent writer will be
28      * used again to emit the rest of the tree.
29      *
30      * @param mountId Mount point identifier
31      * @param mountCtx Mount point context
32      * @return A new NormalizedNodeStreamWriter
33      * @throws IOException if an error occurs
34      */
35     NormalizedNodeStreamWriter startMountPoint(MountPointIdentifier mountId, MountPointContext mountCtx)
36             throws IOException;
37 }