Fix compilation after mdsal implementation movement 92/69692/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 20 Mar 2018 16:36:07 +0000 (17:36 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 20 Mar 2018 16:36:07 +0000 (17:36 +0100)
MDSAL's generator has moved its implementation classes and interfaces,
fix this up.

Change-Id: Ie2607800b67affda966cd0fafb05437263ee9379
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/TemplateFactory.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/TOAttribute.java

index 2220169..2f63795 100644 (file)
@@ -47,6 +47,7 @@ import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Meth
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.ModuleField;
 import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.FullyQualifiedNameHelper;
+import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.ParameterizedType;
 import org.opendaylight.mdsal.binding.model.api.Type;
 import org.opendaylight.yangtools.yang.binding.BindingMapping;
@@ -202,7 +203,7 @@ public class TemplateFactory {
 
         boolean generateRuntime = false;
         String registratorFullyQualifiedName = null;
-        if ((mbe.getRuntimeBeans() != null)
+        if (mbe.getRuntimeBeans() != null
                 && !mbe.getRuntimeBeans().isEmpty()) {
             generateRuntime = true;
             final RuntimeBeanEntry rootEntry = RuntimeRegistratorFtlTemplate
@@ -288,7 +289,7 @@ public class TemplateFactory {
             if (returnType instanceof JavaAttribute) {
                 continue;
             }
-            if ((returnType instanceof ListAttribute) && (returnType.getOpenType() instanceof SimpleType)) {
+            if (returnType instanceof ListAttribute && returnType.getOpenType() instanceof SimpleType) {
                 continue;
             }
 
@@ -492,7 +493,7 @@ public class TemplateFactory {
                     final TypedAttribute typedAttribute = (TypedAttribute) attributeIfc;
                     returnType = serializeType(typedAttribute.getType());
 
-                    if ((attributeIfc instanceof JavaAttribute) && ((JavaAttribute)attrEntry.getValue()).isIdentityRef()) {
+                    if (attributeIfc instanceof JavaAttribute && ((JavaAttribute)attrEntry.getValue()).isIdentityRef()) {
                         returnType = serializeType(identityRefType);
                     }
 
@@ -531,20 +532,11 @@ public class TemplateFactory {
 
     private static final Type identityRefType = new Type() {
         public final Class<IdentityAttributeRef> IDENTITY_ATTRIBUTE_REF_CLASS = IdentityAttributeRef.class;
+        private final JavaTypeName identifier = JavaTypeName.create(IDENTITY_ATTRIBUTE_REF_CLASS);
 
         @Override
-        public String getPackageName() {
-            return this.IDENTITY_ATTRIBUTE_REF_CLASS.getPackage().getName();
-        }
-
-        @Override
-        public String getName() {
-            return this.IDENTITY_ATTRIBUTE_REF_CLASS.getSimpleName();
-        }
-
-        @Override
-        public String getFullyQualifiedName() {
-            return this.IDENTITY_ATTRIBUTE_REF_CLASS.getName();
+        public JavaTypeName getIdentifier() {
+            return identifier;
         }
     };
 
index 2fa4379..d9698cc 100644 (file)
@@ -21,6 +21,7 @@ import javax.management.openmbean.CompositeType;
 import javax.management.openmbean.OpenDataException;
 import javax.management.openmbean.OpenType;
 import org.opendaylight.controller.config.yangjmxgenerator.TypeProviderWrapper;
+import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
 import org.opendaylight.mdsal.binding.model.api.Type;
 import org.opendaylight.mdsal.binding.model.util.ReferencedTypeImpl;
 import org.opendaylight.yangtools.yang.model.api.AugmentationTarget;
@@ -205,7 +206,7 @@ public class TOAttribute extends AbstractAttribute implements TypedAttribute {
     @Override
     public Type getType() {
         // TODO: ReferencedTypeImpl from Types
-        return new ReferencedTypeImpl(this.packageName, getUpperCaseCammelCase());
+        return new ReferencedTypeImpl(JavaTypeName.create(this.packageName, getUpperCaseCammelCase()));
     }
 
     @Override

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.