public interface NodeConverter
NormalizedNode
s (from)into its XML or
JSON representation. Currently there are two implementations XmlNodeConverter
and
JsonNodeConverter
.Modifier and Type | Method and Description |
---|---|
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> |
deserialize(org.opendaylight.yangtools.yang.model.api.SchemaNode schemaNode,
Reader inputData)
This method will deserialize the given input data into
NormalizedNode s. |
Writer |
serializeData(org.opendaylight.yangtools.yang.model.api.SchemaNode schemaNode,
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode)
This method will serialize the given
NormalizedNode into its string representation. |
Writer |
serializeRpc(org.opendaylight.yangtools.yang.model.api.SchemaNode schemaNode,
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode)
This method will serialize the input
NormalizedNode RPC into its string representation. |
Writer serializeData(org.opendaylight.yangtools.yang.model.api.SchemaNode schemaNode, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode) throws SerializationException
NormalizedNode
into its string representation.schemaNode
- parent schema node used during serializationnormalizedNode
- normalized nodes to be serializedWriter
SerializationException
- may be throws while serializing dataConverterUtils.getSchemaNode(SchemaContext, QName)
Writer serializeRpc(org.opendaylight.yangtools.yang.model.api.SchemaNode schemaNode, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode) throws SerializationException
NormalizedNode
RPC into its string representation. It
is highly recommend to use ConverterUtils.loadRpc(SchemaContext, QName)
and proper
input/output definition as the schemaNode parameter.schemaNode
- parent schema node which may be obtained via
ConverterUtils.loadRpc(SchemaContext, QName)
and input/output definitionnormalizedNode
- normalized nodes to be serializedSerializationException
- thrown in case serialization fails.ConverterUtils.rpcAsInput(XmlElement)
,
ConverterUtils.rpcAsOutput(XmlElement)
,
ConverterUtils.getRpcQName(XmlElement)
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> deserialize(org.opendaylight.yangtools.yang.model.api.SchemaNode schemaNode, Reader inputData) throws SerializationException
NormalizedNode
s. In case of RPC
input/output use proper parent schema node obtained via
ConverterUtils.loadRpc(SchemaContext, QName)
.schemaNode
- parent schema nodeinputData
- string representation of input/output RPC or data. In case of RPC the inputData
MUST start with input tag (in case of XML) and object (in case of JSON). The same
goes for RPC outputNormalizedNode
sSerializationException
- is thrown in case of an error during deserializationConverterUtils.loadRpc(SchemaContext, QName)
,
ConverterUtils.rpcAsInput(XmlElement)
,
ConverterUtils.rpcAsOutput(XmlElement)
Copyright © 2020. All rights reserved.