Added InstanceIdentifier to code generation
[yangtools.git] / code-generator / binding-generator-impl / src / main / java / org / opendaylight / yangtools / sal / binding / yang / types / BaseYangTypes.java
index 8c72960c091fff35bf8d2695533455b27b16d165..b76f3b89f096393f199c75f63bf9f88c95283013 100644 (file)
@@ -9,14 +9,14 @@ package org.opendaylight.yangtools.sal.binding.yang.types;
 \r
 import java.math.BigDecimal;\r
 import java.math.BigInteger;\r
-import java.math.BigDecimal;\r
 import java.util.HashMap;\r
 import java.util.Map;\r
 \r
 import org.opendaylight.yangtools.binding.generator.util.Types;\r
 import org.opendaylight.yangtools.sal.binding.generator.spi.TypeProvider;\r
 import org.opendaylight.yangtools.sal.binding.model.api.Type;\r
-\r
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;\r
+import org.opendaylight.yangtools.yang.model.api.SchemaNode;\r
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;\r
 \r
 public final class BaseYangTypes {\r
@@ -92,6 +92,10 @@ public final class BaseYangTypes {
      */\r
     public static final Type BINARY_TYPE = Types.primitiveType("byte[]");\r
 \r
+    \r
+    public static final Type INSTANCE_IDENTIFIER = Types.typeForClass(InstanceIdentifier.class);\r
+    \r
+    \r
     static {\r
         typeMap.put("boolean", BOOLEAN_TYPE);\r
         typeMap.put("empty", EMPTY_TYPE);\r
@@ -106,13 +110,14 @@ public final class BaseYangTypes {
         typeMap.put("uint32", UINT32_TYPE);\r
         typeMap.put("uint64", UINT64_TYPE);\r
         typeMap.put("binary", BINARY_TYPE);\r
+        typeMap.put("instance-identifier", INSTANCE_IDENTIFIER );\r
     }\r
 \r
     public static final TypeProvider BASE_YANG_TYPES_PROVIDER = new TypeProvider() {\r
         /**\r
          * Searches <code>Type</code> value to which is YANG <code>type</code>\r
          * mapped.\r
-         * \r
+         *\r
          * @param type\r
          *            string with YANG type name\r
          * @return java <code>Type</code> representation of <code>type</code>\r
@@ -125,7 +130,7 @@ public final class BaseYangTypes {
         /**\r
          * Searches <code>Type</code> value to which is YANG <code>type</code>\r
          * mapped.\r
-         * \r
+         *\r
          * @param type\r
          *            type definition representation of YANG type\r
          * @return java <code>Type</code> representation of <code>type</code>.\r
@@ -133,7 +138,7 @@ public final class BaseYangTypes {
          *          returned.\r
          */\r
         @Override\r
-        public Type javaTypeForSchemaDefinitionType(TypeDefinition<?> type) {\r
+        public Type javaTypeForSchemaDefinitionType(TypeDefinition<?> type, SchemaNode parentNode) {\r
             if (type != null) {\r
                 return typeMap.get(type.getQName().getLocalName());\r
             }\r