Add OpaqueAnydataExtension and related interfaces
[yangtools.git] / yang / rfc7952-data-api / src / main / java / org / opendaylight / yangtools / rfc7952 / data / api / NormalizedMetadataStreamWriter.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.rfc7952.data.api;
9
10 import com.google.common.annotations.Beta;
11 import com.google.common.collect.ImmutableMap;
12 import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
13 import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriterExtension;
14
15 /**
16  * Extension to the NormalizedNodeStreamWriter with metadata support. Semantically this extends the event model of
17  * {@link NormalizedNodeStreamWriter} with a new event, {@link #metadata(ImmutableMap)}. This event is valid on any
18  * open node. This event may be emitted only once.
19  *
20  * <p>
21  * Note that some implementations of this interface, notably those targeting streaming XML, may require metadata to
22  * be emitted before any other events. Such requirement is communicated through {@link #requireMetadataFirst()} and
23  * users must honor it. If such requirement is not set, metadata may be emitted at any time.
24  *
25  * <p>
26  * Furthermore implementations targeting RFC7952 encoding towards external systems are required to handle metadata
27  * attached to {@code leaf-list} and {@code list} nodes by correctly extending them to each entry.
28  */
29 @Beta
30 public interface NormalizedMetadataStreamWriter extends NormalizedNodeStreamWriterExtension, StreamWriterMethods {
31
32 }