@Beta public interface NormalizedMetadataStreamWriter extends NormalizedNodeStreamWriterExtension
NormalizedNodeStreamWriter
with a new event, metadata(ImmutableMap)
. This event is valid on any
open node. This event may be emitted only once.
Note that some implementations of this interface, notably those targeting streaming XML, may require metadata to
be emitted before any other events. Such requirement is communicated through requireMetadataFirst()
and
users must honor it. If such requirement is not set, metadata may be emitted at any time.
Furthermore implementations targeting RFC7952 encoding towards external systems are required to handle metadata
attached to leaf-list
and list
nodes by correctly extending them to each entry.
Modifier and Type | Method and Description |
---|---|
void |
metadata(ImmutableMap<QName,Object> metadata)
Emit a block of metadata associated with the currently-open node.
|
default boolean |
requireMetadataFirst()
Indicate whether metadata is required to be emitted just after an entry is open.
|
void metadata(ImmutableMap<QName,Object> metadata) throws IOException
md:annotation
extension. Values are normalized objects, which are required to be
effectively-immutable.metadata
- Metadata blockNullPointerException
- if metadata
is nullIllegalStateException
- when this method is invoked outside of an open node or metadata has already been
emitted.IOException
- if an underlying IO error occursdefault boolean requireMetadataFirst()
Copyright © 2020 OpenDaylight. All rights reserved.