2 * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.binding.generator.impl.reactor;
10 import org.opendaylight.yangtools.yang.model.api.stmt.AugmentEffectiveStatement;
13 * Generator corresponding to a {@code augment} statement used as a child of a {@code module} statement.
15 final class ModuleAugmentGenerator extends AbstractAugmentGenerator {
16 ModuleAugmentGenerator(final AugmentEffectiveStatement statement, final AbstractCompositeGenerator<?> parent) {
17 super(statement, parent);
21 void loadTargetGenerator() {
22 throw new UnsupportedOperationException();
25 void linkAugmentationTarget(final GeneratorContext context) {
26 // FIXME: we need two-step resolution here:
28 // if (targetSchemaNode instanceof DataSchemaNode && ((DataSchemaNode) targetSchemaNode).isAddedByUses()) {
29 // if (targetSchemaNode instanceof DerivableSchemaNode) {
30 // targetSchemaNode = ((DerivableSchemaNode) targetSchemaNode).getOriginal().orElse(null);
32 // if (targetSchemaNode == null) {
33 // throw new IllegalStateException("Failed to find target node from grouping in augmentation " + augSchema
34 // + " in module " + context.module().getName());
38 setTargetGenerator(context.resolveSchemaNode(statement().argument()));