- for (SchemaNode superChildNode : superNode.getChildNodes()) {
- if (superChildNode instanceof DataNodeContainer) {
- final QName childQName = QName.create(((SchemaNode)node).getQName(), superChildNode.getQName().getLocalName());
- DataSchemaNode childNode = node.getDataChildByName(childQName);
- Preconditions.checkNotNull(childNode, ((SchemaNode) node).getPath() + "->" + childQName.toString());
-
- final GeneratedTypeBuilder type = genCtx.get(module).getChildNode(childNode.getPath());
- final GeneratedTypeBuilder superType = genCtx.get(superModule).getChildNode(superChildNode.getPath());
-
- //TODO:delete this after supporting uses augment
- if (type == null || superType == null) {
- return;
- }
- Preconditions.checkNotNull(type, module.toString() + "->" + childNode.getPath().toString());
- Preconditions.checkNotNull(superType, superModule.toString() + "->" + superChildNode.getPath().toString());
- type.addImplementsType(superType);
- if (superChildNode instanceof ListSchemaNode
- && !((ListSchemaNode)superChildNode).getKeyDefinition().isEmpty()) {
- if (namespaceType.equals(BindingNamespaceType.Grouping)) {
- genCtx.get(module).getKeyType(childNode.getPath())
- .addImplementsType(genCtx.get(superModule).getKeyType(superChildNode.getPath()));
- } else if (namespaceType.equals(BindingNamespaceType.Data)){
- genCtx.get(module).getKeyGenTO(childNode.getPath())
- .addImplementsType(genCtx.get(superModule).getKeyType(superChildNode.getPath()));
+
+ if (superNode instanceof DataNodeContainer) {
+ for (DataSchemaNode superChildNode : ((DataNodeContainer)superNode).getChildNodes()) {
+ if (superChildNode instanceof DataNodeContainer || superChildNode instanceof ChoiceSchemaNode) {
+ final QName childQName = QName.create(node.getQName(), superChildNode.getQName().getLocalName());
+ DataSchemaNode childNode = ((DataNodeContainer)node).getDataChildByName(childQName);
+ Preconditions.checkNotNull(childNode, node.getPath() + "->" + childQName.toString());
+
+ final GeneratedTypeBuilder type = genCtx.get(module).getChildNode(childNode.getPath());
+ final GeneratedTypeBuilder superType = genCtx.get(superModule).getChildNode(superChildNode.getPath());
+
+ //TODO:delete this after supporting uses augment
+ if (type == null || superType == null) {
+ return;