- private ChoiceCaseNode detectCase(DataContainerChild<?, ?> child) {
- for (ChoiceCaseNode choiceCaseNode : schema.getCases()) {
- for (DataSchemaNode childFromCase : choiceCaseNode.getChildNodes()) {
- if (childFromCase.getQName().equals(child.getNodeType())) {
- return choiceCaseNode;
- }
- }
- }
-
- throw new IllegalArgumentException(String.format("Unknown child node: %s, for choice: %s", child.getNodeType(),
- schema.getQName()));
- }
-