Package io.lighty.codecs.api
Interface NodeConverter
-
- All Known Implementing Classes:
JsonNodeConverter
,XmlNodeConverter
@Deprecated(forRemoval=true) public interface NodeConverter
Deprecated, for removal: This API element is subject to removal in a future version.This interface is moved to lighty-codecs-util.This interface may be useful when (de)serializingNormalizedNode
s (from)into its XML or JSON representation. Currently there are two implementationsXmlNodeConverter
andJsonNodeConverter
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?>
deserialize(org.opendaylight.yangtools.yang.model.api.SchemaNode schemaNode, Reader inputData)
Deprecated, for removal: This API element is subject to removal in a future version.This method will deserialize the given input data intoNormalizedNode
s.Writer
serializeData(org.opendaylight.yangtools.yang.model.api.SchemaNode schemaNode, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode)
Deprecated, for removal: This API element is subject to removal in a future version.This method will serialize the givenNormalizedNode
into its string representation.Writer
serializeRpc(org.opendaylight.yangtools.yang.model.api.SchemaNode schemaNode, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode)
Deprecated, for removal: This API element is subject to removal in a future version.This method will serialize the inputNormalizedNode
RPC into its string representation.
-
-
-
Method Detail
-
serializeData
Writer serializeData(org.opendaylight.yangtools.yang.model.api.SchemaNode schemaNode, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode) throws SerializationException
Deprecated, for removal: This API element is subject to removal in a future version.This method will serialize the givenNormalizedNode
into its string representation.- Parameters:
schemaNode
- parent schema node used during serializationnormalizedNode
- normalized nodes to be serialized- Returns:
Writer
- Throws:
SerializationException
- may be throws while serializing data- See Also:
ConverterUtils.getSchemaNode(EffectiveModelContext, QName)
-
serializeRpc
Writer serializeRpc(org.opendaylight.yangtools.yang.model.api.SchemaNode schemaNode, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode) throws SerializationException
Deprecated, for removal: This API element is subject to removal in a future version.This method will serialize the inputNormalizedNode
RPC into its string representation. It is highly recommend to useConverterUtils.loadRpc(SchemaContext, QName)
and proper input/output definition as the schemaNode parameter.- Parameters:
schemaNode
- parent schema node which may be obtained viaConverterUtils.loadRpc(SchemaContext, QName)
and input/output definitionnormalizedNode
- normalized nodes to be serialized- Returns:
- string representation of the given nodes starting with input or output tag
- Throws:
SerializationException
- thrown in case serialization fails.- See Also:
ConverterUtils.rpcAsInput(XmlElement)
,ConverterUtils.rpcAsOutput(XmlElement)
,ConverterUtils.getRpcQName(XmlElement)
-
deserialize
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> deserialize(org.opendaylight.yangtools.yang.model.api.SchemaNode schemaNode, Reader inputData) throws SerializationException
Deprecated, for removal: This API element is subject to removal in a future version.This method will deserialize the given input data intoNormalizedNode
s. In case of RPC input/output use proper parent schema node obtained viaConverterUtils.loadRpc(SchemaContext, QName)
.- Parameters:
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 output- Returns:
- deserialized
NormalizedNode
s - Throws:
SerializationException
- is thrown in case of an error during deserialization- See Also:
ConverterUtils.loadRpc(SchemaContext, QName)
,ConverterUtils.rpcAsInput(XmlElement)
,ConverterUtils.rpcAsOutput(XmlElement)
-
-