We have a way to construct a NormalizedNode hierarchy, which is sadly tied to a particular implementation. There are a few use cases, where we really mean to push the state of a YangInstanceIdentifier into a NormalizedNodeStreamWriter and then emit a number of NormalizedNodes and close the identifier.
Refactoring this utility method would allow users side-step the NormalizedNode representation and ditch quite a bit of complexity – with the following construct:
YangInstanceIdentifier id = ...; NormalizedNodeStreamWriter writer = ...; try (var nnWriter = NormalizedNodeWriter.forStreamWriter(writer)) { try (var idCtx = nnWriter.enterPath(id)) { // here we have emitted the events to 'enter' structure indicated by the id // and can proceed to, for example nnWriter.writeNormalizedNode(...); } // here we are again outside of the id, having rolled back the changes }
- is duplicated by
-
YANGTOOLS-898 Rework ImmutableNodes.fromInstanceId()
- Resolved
- relates to
-
YANGTOOLS-1433 YangInstanceIdentifierWriter does not handle nested augmentations
- Resolved
-
YANGTOOLS-1402 Consider adding YangInstanceIdentifier+NormalizedNode-based codec utilities
- Confirmed