public interface YangSerializer
DataNode structures, which are in-memory representations of
YANG models, to and from various external representations, e.g. XML, JSON.
This interface is not intended for use by applications, but rather only by the YANG runtime implementation.
| Modifier and Type | Method and Description |
|---|---|
CompositeData |
decode(CompositeStream external,
YangSerializerContext context)
Decodes the external representation of a configuration model from the
specified composite stream into an in-memory representation.
|
CompositeStream |
encode(CompositeData internal,
YangSerializerContext context)
Encodes the internal in-memory representation of a configuration model
to an external representation consumable from the resulting input stream.
|
String |
supportsFormat()
Returns the data format supported by this serializer.
|
String supportsFormat()
CompositeData decode(CompositeStream external, YangSerializerContext context)
Resource identifier stream "URI" will get decoded to resource identifier and resource data stream will get decoded to data node.
Protocols like NETCONF may opt only to have resource data without resource identifier, which implies the data node construction from logical root resource ("/").
Also protocols like NETCONF will have decorations around the input stream which will be reported back to protocol in output. Produced annotations will be in order of pre-order traversal.
external - composite input stream carrying external
representation of configuration datacontext - YANG serializer contextYangRuntimeException - when fails to perform decode operationCompositeStream encode(CompositeData internal, YangSerializerContext context)
Resource identifier in composite data will get encoded to resource identifier stream and data node will be encoded to resource data stream.
Logical root node "/" will be removed during encoding and will not be part of either resource identifier or data node.
Protocols like NETCONF may opt only to have data node with resource identifier as null in order to only get complete output in form of body without URI.
Also protocols like NETCONF would like to provide additional decorations for the node. These decoration should be in pre-order traversal order.
internal - in-memory representation of configuration datacontext - YANG serializer contextYangRuntimeException - when fails to perform decode operationCopyright © 2017. All rights reserved.