X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fconfig-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fconfignetconfconnector%2Fmapping%2Fattributes%2FAttributeIfcSwitchStatement.java;h=c08be06c9f619bfc48ff144f523f64535cb8a605;hb=refs%2Fchanges%2F99%2F5599%2F14;hp=cf0e71e67a52ab9983b5a2599519cf9f3014118c;hpb=1ff9939abc7a4072b07df6b79516fe344b1b42e3;p=controller.git diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/AttributeIfcSwitchStatement.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/AttributeIfcSwitchStatement.java index cf0e71e67a..c08be06c9f 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/AttributeIfcSwitchStatement.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/AttributeIfcSwitchStatement.java @@ -8,6 +8,11 @@ package org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes; +import javax.management.openmbean.ArrayType; +import javax.management.openmbean.CompositeType; +import javax.management.openmbean.OpenType; +import javax.management.openmbean.SimpleType; + import org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc; import org.opendaylight.controller.config.yangjmxgenerator.attribute.DependencyAttribute; import org.opendaylight.controller.config.yangjmxgenerator.attribute.JavaAttribute; @@ -16,14 +21,9 @@ import org.opendaylight.controller.config.yangjmxgenerator.attribute.ListDepende import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; import org.opendaylight.yangtools.yang.model.api.type.BinaryTypeDefinition; -import javax.management.openmbean.ArrayType; -import javax.management.openmbean.CompositeType; -import javax.management.openmbean.OpenType; -import javax.management.openmbean.SimpleType; - public abstract class AttributeIfcSwitchStatement { - protected AttributeIfc lastAttribute; + private AttributeIfc lastAttribute; public T switchAttribute(AttributeIfc attributeIfc) { @@ -37,8 +37,11 @@ public abstract class AttributeIfcSwitchStatement { return caseJavaBinaryAttribute(openType); } else if(((JavaAttribute)attributeIfc).isUnion()) { return caseJavaUnionAttribute(openType); - } else + } else if(((JavaAttribute)attributeIfc).isIdentityRef()) { + return caseJavaIdentityRefAttribute(openType); + } else { return caseJavaAttribute(openType); + } } catch (UnknownOpenTypeException e) { throw getIllegalArgumentException(attributeIfc); } @@ -56,6 +59,14 @@ public abstract class AttributeIfcSwitchStatement { throw getIllegalArgumentException(attributeIfc); } + public AttributeIfc getLastAttribute() { + return lastAttribute; + } + + protected T caseJavaIdentityRefAttribute(OpenType openType) { + return caseJavaAttribute(openType); + } + protected T caseJavaUnionAttribute(OpenType openType) { return caseJavaAttribute(openType); } @@ -96,6 +107,8 @@ public abstract class AttributeIfcSwitchStatement { protected abstract T caseListDependeciesAttribute(ArrayType openType); private static class UnknownOpenTypeException extends RuntimeException { + private static final long serialVersionUID = 1L; + public UnknownOpenTypeException(String message) { super(message); }