schema = dsn;
}
} else if (dsn instanceof ChoiceSchemaNode) {
- for (final ChoiceCaseNode choiceCase : ((ChoiceSchemaNode) dsn).getCases()) {
+ for (final ChoiceCaseNode choiceCase : ((ChoiceSchemaNode) dsn).getCases().values()) {
final DataSchemaNode dataChildByName = choiceCase.getDataChildByName(qname);
if (dataChildByName != null) {
}
public static DataSchemaNode findSchemaForChild(final ChoiceSchemaNode schema, final QName childPartialQName) {
- for (final ChoiceCaseNode choiceCaseNode : schema.getCases()) {
+ for (final ChoiceCaseNode choiceCaseNode : schema.getCases().values()) {
final Optional<DataSchemaNode> childSchema = findFirstSchema(childPartialQName,
choiceCaseNode.getChildNodes());
if (childSchema.isPresent()) {
}
public static AugmentationSchemaNode findSchemaForAugment(final ChoiceSchemaNode schema, final Set<QName> qnames) {
- for (final ChoiceCaseNode choiceCaseNode : schema.getCases()) {
+ for (final ChoiceCaseNode choiceCaseNode : schema.getCases().values()) {
final Optional<AugmentationSchemaNode> schemaForAugment = findAugment(choiceCaseNode, qnames);
if (schemaForAugment.isPresent()) {
return schemaForAugment.get();
continue;
}
- for (final ChoiceCaseNode choiceCaseNode : ((ChoiceSchemaNode) childSchema).getCases()) {
+ for (final ChoiceCaseNode choiceCaseNode : ((ChoiceSchemaNode) childSchema).getCases().values()) {
for (final QName qname : getChildNodesRecursive(choiceCaseNode)) {
mappedChoices.put(qname, (ChoiceSchemaNode) childSchema);
}
childNodesToAugmentation.put(qname, mostTopAugmentation);
}
} else if (child instanceof ChoiceSchemaNode) {
- for (final ChoiceCaseNode choiceCaseNode : ((ChoiceSchemaNode) child).getCases()) {
+ for (final ChoiceCaseNode choiceCaseNode : ((ChoiceSchemaNode) child).getCases().values()) {
for (final QName qname : getChildNodesRecursive(choiceCaseNode)) {
childNodesToAugmentation.put(qname, mostTopAugmentation);
}
// Choice Node has to map child nodes from all its cases
if (schema instanceof ChoiceSchemaNode) {
- for (final ChoiceCaseNode choiceCaseNode : ((ChoiceSchemaNode) schema).getCases()) {
+ for (final ChoiceCaseNode choiceCaseNode : ((ChoiceSchemaNode) schema).getCases().values()) {
if (!augments.containsKey(choiceCaseNode.getQName())) {
continue;
}
for (final DataSchemaNode childSchema : nodeContainer.getChildNodes()) {
if (childSchema instanceof ChoiceSchemaNode) {
- for (final ChoiceCaseNode choiceCaseNode : ((ChoiceSchemaNode) childSchema).getCases()) {
+ for (final ChoiceCaseNode choiceCaseNode : ((ChoiceSchemaNode) childSchema).getCases().values()) {
allChildNodes.addAll(getChildNodesRecursive(choiceCaseNode));
}
} else if (childSchema instanceof AugmentationSchemaNode || childSchema instanceof ChoiceCaseNode) {
final Set<DataSchemaNode> realChildNodes = new HashSet<>();
if (targetSchema instanceof ChoiceSchemaNode) {
for (final DataSchemaNode dataSchemaNode : augmentSchema.getChildNodes()) {
- for (final ChoiceCaseNode choiceCaseNode : ((ChoiceSchemaNode) targetSchema).getCases()) {
+ for (final ChoiceCaseNode choiceCaseNode : ((ChoiceSchemaNode) targetSchema).getCases().values()) {
if (getChildNodesRecursive(choiceCaseNode).contains(dataSchemaNode.getQName())) {
realChildNodes.add(choiceCaseNode.getDataChildByName(dataSchemaNode.getQName()));
}
public static Optional<ChoiceCaseNode> detectCase(final ChoiceSchemaNode schema,
final DataContainerChild<?, ?> child) {
- for (final ChoiceCaseNode choiceCaseNode : schema.getCases()) {
+ for (final ChoiceCaseNode choiceCaseNode : schema.getCases().values()) {
if (child instanceof AugmentationNode
&& belongsToCaseAugment(choiceCaseNode, (AugmentationIdentifier) child.getIdentifier())) {
return Optional.of(choiceCaseNode);