} catch (final XMLStreamException | FactoryConfigurationError e) {
throw new IllegalStateException(e);
}
- final NormalizedNode<?, ?> data = context.getData();
+ final NormalizedNode data = context.getData();
final SchemaPath schemaPath = pathContext.getSchemaNode().getPath();
writeNormalizedNode(xmlWriter, schemaPath, pathContext, data, context.getWriterParameters().getDepth());
}
private static void writeNormalizedNode(final XMLStreamWriter xmlWriter, final SchemaPath schemaPath,
- final InstanceIdentifierContext<?> pathContext, NormalizedNode<?, ?> data, final @Nullable Integer depth)
+ final InstanceIdentifierContext<?> pathContext, NormalizedNode data, final @Nullable Integer depth)
throws IOException {
final RestconfNormalizedNodeWriter nnWriter;
final EffectiveModelContext schemaCtx = pathContext.getSchemaContext();
try {
writeElements(xmlWriter, nnWriter,
(ContainerNode) NetconfUtil.transformDOMSourceToNormalizedNode(schemaCtx,
- ((DOMSourceAnyxmlNode)data).getValue()).getResult());
+ ((DOMSourceAnyxmlNode)data).body()).getResult());
} catch (XMLStreamException | URISyntaxException | SAXException e) {
throw new IOException("Cannot write anyxml", e);
}
if (data instanceof MapEntryNode) {
// Restconf allows returning one list item. We need to wrap it
// in map node in order to serialize it properly
- data = ImmutableNodes.mapNodeBuilder(data.getNodeType()).addChild((MapEntryNode) data).build();
+ data = ImmutableNodes.mapNodeBuilder(data.getIdentifier().getNodeType())
+ .addChild((MapEntryNode) data)
+ .build();
}
nnWriter.write(data);
}
private static void writeElements(final XMLStreamWriter xmlWriter, final RestconfNormalizedNodeWriter nnWriter,
final ContainerNode data) throws IOException {
- final QName name = data.getNodeType();
+ final QName name = data.getIdentifier().getNodeType();
try {
xmlWriter.writeStartElement(XMLConstants.DEFAULT_NS_PREFIX, name.getLocalName(),
name.getNamespace().toString());
xmlWriter.writeDefaultNamespace(name.getNamespace().toString());
- for (final NormalizedNode<?,?> child : data.getValue()) {
+ for (final NormalizedNode child : data.body()) {
nnWriter.write(child);
}
nnWriter.flush();