X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frest%2Fimpl%2FXmlReader.java;h=a53281492f23f28bd3e912c51cb8ae1ba1a752fa;hb=e640f23d9c37afac9ca51f48e155302bc65327ed;hp=bf7ff7d43524732f067982042fb46e19f3d35134;hpb=a56c86e7e72e2e9c1fd1845358955eba80381ce1;p=controller.git diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/XmlReader.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/XmlReader.java index bf7ff7d435..a53281492f 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/XmlReader.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/XmlReader.java @@ -14,8 +14,10 @@ import javax.xml.stream.events.StartElement; import javax.xml.stream.events.XMLEvent; import org.opendaylight.controller.sal.restconf.impl.CompositeNodeWrapper; +import org.opendaylight.controller.sal.restconf.impl.EmptyNodeWrapper; import org.opendaylight.controller.sal.restconf.impl.NodeWrapper; import org.opendaylight.controller.sal.restconf.impl.SimpleNodeWrapper; +import org.opendaylight.yangtools.yang.data.api.Node; public class XmlReader { @@ -121,7 +123,7 @@ public class XmlReader { return false; } - private SimpleNodeWrapper resolveSimpleNodeFromStartElement(final StartElement startElement) + private NodeWrapper> resolveSimpleNodeFromStartElement(final StartElement startElement) throws XMLStreamException { checkArgument(startElement != null, "Start Element cannot be NULL!"); String data = null; @@ -141,7 +143,9 @@ public class XmlReader { } } } - + if(data == null) { + return new EmptyNodeWrapper(getNamespaceFrom(startElement), getLocalNameFrom(startElement)); + } return new SimpleNodeWrapper(getNamespaceFrom(startElement), getLocalNameFrom(startElement), data); }