Update NormalizedMetadata(StreamWriter) design
While having a complete decomposition of metadata blocks would be
a nice design, it is not efficient for our current use:
- NormalizedMetadata has the block readily-available
- Both JSON and XML parsers fully assemble attributes before
emitting them. Even if the implementation changes, both parsers
can very easily assemble the full block, as XML encodes it just
after the element and JSON uses dedicated objects.
- NETCONF edit-config processing requires metadata to be visible
before it can decide how to process the node
This patch changes NormalizedMetadataStreamWriter have a single
metadata() event, which takes an ImmutableMap. This communicates
the intent quite clearly and allows for optimizations on both ends.
JIRA: YANGTOOLS-961
Change-Id: I638c78d5ab1d3a8b544ab53a84b872420b49d637
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>