X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fsal%2Fyang-prototype%2Fcode-generator%2Fyang-model-parser-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fyang%2Fparser%2Futil%2FYangModelBuilderUtil.java;h=e63f12839dfa8d4d883806bccf6f5e226d45a5bc;hp=873e3842db0097cb17ec4d1fb6dbd5edd039451b;hb=0f393657ea0987d02556ea6e2a367d492a8e5a04;hpb=35ba67e73cf9fea55535c1aef8303e7d12c982e7 diff --git a/opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/YangModelBuilderUtil.java b/opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/YangModelBuilderUtil.java index 873e3842db..e63f12839d 100644 --- a/opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/YangModelBuilderUtil.java +++ b/opendaylight/sal/yang-prototype/code-generator/yang-model-parser-impl/src/main/java/org/opendaylight/controller/yang/parser/util/YangModelBuilderUtil.java @@ -1008,60 +1008,51 @@ public final class YangModelBuilderUtil { List enumConstants = getEnumConstants( typeBody, actualPath, namespace, revision, prefix); + SchemaPath schemaPath = createActualSchemaPath(actualPath, namespace, + revision, prefix); + if ("decimal64".equals(typeName)) { - type = new Decimal64(actualPath, namespace, revision, - fractionDigits); + type = new Decimal64(schemaPath, fractionDigits); } else if (typeName.startsWith("int")) { if ("int8".equals(typeName)) { - type = new Int8(actualPath, namespace, revision, - rangeStatements, null, null); + type = new Int8(schemaPath, rangeStatements, null, null); } else if ("int16".equals(typeName)) { - type = new Int16(actualPath, namespace, revision, - rangeStatements, null, null); + type = new Int16(schemaPath, rangeStatements, null, null); } else if ("int32".equals(typeName)) { - type = new Int32(actualPath, namespace, revision, - rangeStatements, null, null); + type = new Int32(schemaPath, rangeStatements, null, null); } else if ("int64".equals(typeName)) { - type = new Int64(actualPath, namespace, revision, - rangeStatements, null, null); + type = new Int64(schemaPath, rangeStatements, null, null); } } else if (typeName.startsWith("uint")) { if ("uint8".equals(typeName)) { - type = new Uint8(actualPath, namespace, revision, - rangeStatements, null, null); + type = new Uint8(schemaPath, rangeStatements, null, null); } else if ("uint16".equals(typeName)) { - type = new Uint16(actualPath, namespace, revision, - rangeStatements, null, null); + type = new Uint16(schemaPath, rangeStatements, null, null); } else if ("uint32".equals(typeName)) { - type = new Uint32(actualPath, namespace, revision, - rangeStatements, null, null); + type = new Uint32(schemaPath, rangeStatements, null, null); } else if ("uint64".equals(typeName)) { - type = new Uint64(actualPath, namespace, revision, - rangeStatements, null, null); + type = new Uint64(schemaPath, rangeStatements, null, null); } } else if ("enumeration".equals(typeName)) { - type = new EnumerationType(actualPath, namespace, revision, - enumConstants); + type = new EnumerationType(schemaPath, enumConstants); } else if ("string".equals(typeName)) { - type = new StringType(actualPath, namespace, revision, - lengthStatements, patternStatements); + type = new StringType(schemaPath, lengthStatements, + patternStatements); } else if ("bits".equals(typeName)) { - type = new BitsType(actualPath, namespace, revision, getBits( - typeBody, actualPath, namespace, revision, prefix)); + type = new BitsType(schemaPath, getBits(typeBody, actualPath, + namespace, revision, prefix)); } else if ("leafref".equals(typeName)) { final String path = parseLeafrefPath(typeBody); final boolean absolute = path.startsWith("/"); RevisionAwareXPath xpath = new RevisionAwareXPathImpl(path, absolute); - type = new Leafref(actualPath, namespace, revision, xpath); + type = new Leafref(schemaPath, xpath); } else if ("binary".equals(typeName)) { List bytes = Collections.emptyList(); - type = new BinaryType(actualPath, namespace, revision, bytes, - lengthStatements, null); + type = new BinaryType(schemaPath, bytes, lengthStatements, null); } else if ("instance-identifier".equals(typeName)) { boolean requireInstance = isRequireInstance(typeBody); - type = new InstanceIdentifier(actualPath, namespace, revision, - null, requireInstance); + type = new InstanceIdentifier(schemaPath, null, requireInstance); } return type; }