final String packageName = packageNameForGeneratedType(basePackageName, choiceNode.getPath()); final GeneratedTypeBuilder choiceTypeBuilder = addRawInterfaceDefinition(packageName, choiceNode); constructGetter(parent, choiceNode.getQName().getLocalName(), choiceNode.getDescription(),
final SchemaPath nodeSp = targetNode.getPath(); parent = findDataSchemaNode(schemaContext, nodeSp.getParent());
final Iterable<DataSchemaNode> caseChildNodes = caseNode.getChildNodes(); if (caseChildNodes != null) { final SchemaPath choiceNodeParentPath = choiceNode.getPath().getParent();
private GeneratedTypeBuilder findChildOfType(final ChoiceSchemaNode targetNode) { final SchemaPath nodePath = targetNode.getPath(); final SchemaPath parentSp = nodePath.getParent(); if (parentSp.getParent() == null) { return moduleContext(nodePath.getLastComponent().getModule()).getModuleNode(); } final SchemaNode parent = findDataSchemaNode(schemaContext, parentSp); GeneratedTypeBuilder childOfType = null; if (parent instanceof CaseSchemaNode) { childOfType = findCaseByPath(parent.getPath()); } else if (parent instanceof DataSchemaNode || parent instanceof NotificationDefinition) { childOfType = findChildNodeByPath(parent.getPath()); } else if (parent instanceof GroupingDefinition) { childOfType = findGroupingByPath(parent.getPath()); } if (childOfType == null) { throw new IllegalArgumentException("Failed to find parent type of choice " + targetNode); } return childOfType; }
final Iterable<DataSchemaNode> caseChildNodes = caseNode.getChildNodes(); if (caseChildNodes != null) { final SchemaPath choiceNodeParentPath = choiceNode.getPath().getParent();
JavaTypeName.create(packageNameForGeneratedType(context.modulePackageName(), choiceNode.getPath()), BindingMapping.getClassName(choiceNode.getQName())), choiceNode); choiceTypeBuilder.addImplementsType(choiceIn(parent));