Move NormalizedMetadataWriter to yang-data-api
[yangtools.git] / data / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / MountPointChild.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.yang.data.api.schema;
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.model.api.EffectiveModelContext;
15
16 /**
17  * An unresolved child within a mount point. This is similar in functionality to {@link NormalizableAnydata}, but
18  * rather than normalizing, the data is fed into a combination of an EffectiveModelContext and a
19  * NormalizedNodeStreamWriter.
20  */
21 @Beta
22 @NonNullByDefault
23 public interface MountPointChild {
24     /**
25      * Stream this child into a writer, with the help of a SchemaContext.
26      *
27      * @param writer Writer to emit the child into
28      * @param mountCtx MountPointContext for normalization purposes
29      * @throws IOException if an underlying error occurs
30      * @throws NullPointerException if any of the arguments is null
31      */
32     void writeTo(NormalizedNodeStreamWriter writer, MountPointContext mountCtx) throws IOException;
33
34     /**
35      * Normalized this child to a particular EffectiveModelContext.
36      *
37      * @param schemaContext SchemaContext for normalization purposes
38      * @return A NormalizedNode representation of this child
39      * @throws IOException if an underlying error occurs
40      * @throws NullPointerException if any of the arguments is null
41      */
42     NormalizedNode normalizeTo(EffectiveModelContext schemaContext) throws IOException;
43 }