X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fconfig-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fconfignetconfconnector%2Fmapping%2Fattributes%2Ffromxml%2FAbstractAttributeReadingStrategy.java;h=701e96ecd95b8853fcee8ccf75b98a9ac6cb1b47;hp=867d94e0b70f628a1454cde825f44d6c27233528;hb=84248dac9ed8aa37e996e39429c8aa8ece473eaf;hpb=16f2dc509f9f9429447bf9dc59c6c56cd09a7fc3 diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/AbstractAttributeReadingStrategy.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/AbstractAttributeReadingStrategy.java index 867d94e0b7..701e96ecd9 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/AbstractAttributeReadingStrategy.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/fromxml/AbstractAttributeReadingStrategy.java @@ -8,6 +8,7 @@ package org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes.fromxml; +import org.opendaylight.controller.netconf.api.NetconfDocumentedException; import org.opendaylight.controller.netconf.util.xml.XmlElement; import java.util.List; @@ -25,13 +26,16 @@ public abstract class AbstractAttributeReadingStrategy implements AttributeReadi } @Override - public AttributeConfigElement readElement(List configNodes) { - if (configNodes.size() == 0) - return AttributeConfigElement.createNullValue(nullableDefault); - + public AttributeConfigElement readElement(List configNodes) throws NetconfDocumentedException { + if (configNodes.size() == 0){ + return AttributeConfigElement.createNullValue(postprocessNullableDefault(nullableDefault)); + } return readElementHook(configNodes); } - abstract AttributeConfigElement readElementHook(List configNodes); + abstract AttributeConfigElement readElementHook(List configNodes) throws NetconfDocumentedException; + protected Object postprocessNullableDefault(String nullableDefault) { + return nullableDefault; + } }