Adjust for NormalizedNodeStreamWriter.startAnyxmlNode() changing 13/84813/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 30 Sep 2019 15:29:13 +0000 (17:29 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 30 Sep 2019 15:29:13 +0000 (17:29 +0200)
The baseline interface now propagates the intended object model,
handle it accordingly.

Change-Id: I9b68801a2a1ee20d86599432fe6b593007836807
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/BindingToNormalizedStreamWriter.java

index 7b9117fb8d0e96baaad4954953f32286244b9f1f..a3513f74faaf57ba719d57d96820643c4acf79d1 100644 (file)
@@ -139,9 +139,11 @@ final class BindingToNormalizedStreamWriter implements AnydataBindingStreamWrite
     @Override
     public void anyxmlNode(final String name, final Object value) throws IOException {
         final Entry<NodeIdentifier, Object> dom = serializeLeaf(name, value);
-        delegate.startAnyxmlNode(dom.getKey());
-        delegate.domSourceValue((DOMSource) dom.getValue());
-        delegate.endNode();
+        // FIXME: this is not quite right -- we should be handling other object models, too
+        if (delegate.startAnyxmlNode(dom.getKey(), DOMSource.class)) {
+            delegate.domSourceValue((DOMSource) dom.getValue());
+            delegate.endNode();
+        }
     }
 
     @Override